Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Commit

Permalink
Enforced coding style on project
Browse files Browse the repository at this point in the history
  • Loading branch information
Jofairden committed Jul 11, 2017
1 parent 0f1c3ac commit 613aa4c
Show file tree
Hide file tree
Showing 1,311 changed files with 6,915 additions and 7,325 deletions.
11 changes: 6 additions & 5 deletions AlchemistItem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Xna.Framework;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;

Expand All @@ -7,24 +8,24 @@ namespace Tremor
public abstract class AlchemistItem : ModItem
{

public override void ModifyTooltips(System.Collections.Generic.List<TooltipLine> tooltips)
public override void ModifyTooltips(List<TooltipLine> tooltips)
{
for (int i = 0; i < tooltips.Count; ++i)
{
if (tooltips[i].Name == "Damage")
{
MPlayer mp = Main.LocalPlayer.GetModPlayer<MPlayer>(mod);
tooltips[i].text = ((int)(item.damage * mp.alchemistDamage)).ToString() + " alchemic damage";
tooltips[i].text = ((int)(item.damage * mp.alchemistDamage)) + " alchemic damage";
}

if (tooltips[i].Name == "CritChance")
{
MPlayer mp = Main.LocalPlayer.GetModPlayer<MPlayer>(mod);
tooltips[i].text = ((int)(item.crit + mp.alchemistCrit)).ToString() + "% critical strike chance";
tooltips[i].text = (item.crit + mp.alchemistCrit) + "% critical strike chance";
}
}
MPlayer mp2 = Main.LocalPlayer.GetModPlayer<MPlayer>(mod);
TooltipLine tip = new TooltipLine(mod, "Tremor:Tooltip", ((int)(item.crit + mp2.alchemistCrit)).ToString() + "% critical strike chance");
TooltipLine tip = new TooltipLine(mod, "Tremor:Tooltip", (item.crit + mp2.alchemistCrit) + "% critical strike chance");
tooltips.Insert(2, tip);
}

Expand Down
8 changes: 4 additions & 4 deletions Angle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ public bool ClockwiseFrom(Angle other)
{
if (other.Value >= (float)Math.PI)
{
return this.Value < other.Value && this.Value >= other.Opposite().Value;
return Value < other.Value && Value >= other.Opposite().Value;
}
return this.Value < other.Value || this.Value >= other.Opposite().Value;
return Value < other.Value || Value >= other.Opposite().Value;
}

public bool Between(Angle cLimit, Angle ccLimit)
{
if (cLimit.Value < ccLimit.Value)
{
return this.Value >= cLimit.Value && this.Value <= ccLimit.Value;
return Value >= cLimit.Value && Value <= ccLimit.Value;
}
return this.Value >= cLimit.Value || this.Value <= ccLimit.Value;
return Value >= cLimit.Value || Value <= ccLimit.Value;
}
}
}
2 changes: 1 addition & 1 deletion Buffs/AnnoyingDogBuff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public override void Update(Player player, ref int buffIndex)
}
if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("AnnoyingDog"), 0, 0f, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("AnnoyingDog"), 0, 0f, player.whoAmI, 0f, 0f);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Buffs/BruttyBuff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public override void Update(Player player, ref int buffIndex)
}
if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("Brutty"), 0, 0f, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("Brutty"), 0, 0f, player.whoAmI, 0f, 0f);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Buffs/EmeraldStoneBuff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public override void Update(Player player, ref int buffIndex)
}
if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("Emeraldy"), 0, 0f, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("Emeraldy"), 0, 0f, player.whoAmI, 0f, 0f);
}
if ((player.controlDown && player.releaseDown))
{
Expand Down
2 changes: 1 addition & 1 deletion Buffs/GoldenWhale.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public override void Update(Player player, ref int buffIndex)
}
if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("GoldenWhalePro"), 0, 0f, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("GoldenWhalePro"), 0, 0f, player.whoAmI, 0f, 0f);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Buffs/GurdPetBuff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public override void Update(Player player, ref int buffIndex)
}
if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("GurdPet"), 0, 0f, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("GurdPet"), 0, 0f, player.whoAmI, 0f, 0f);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Buffs/LivingTombstoneBuff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public override void Update(Player player, ref int buffIndex)
}
if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("LivingTombstonePro"), 0, 0f, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("LivingTombstonePro"), 0, 0f, player.whoAmI, 0f, 0f);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Buffs/MudDollBuff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public override void Update(Player player, ref int buffIndex)
}
if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("MudDoll"), 0, 0f, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("MudDoll"), 0, 0f, player.whoAmI, 0f, 0f);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Buffs/NebulaJellyfishBuff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public override void Update(Player player, ref int buffIndex)
}
if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("NebulaJellyfish"), 0, 0f, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("NebulaJellyfish"), 0, 0f, player.whoAmI, 0f, 0f);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Buffs/SolarMeteorBuff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public override void Update(Player player, ref int buffIndex)
}
if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("SolarMeteor"), 0, 0f, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("SolarMeteor"), 0, 0f, player.whoAmI, 0f, 0f);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Buffs/StardustSquidBuff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public override void Update(Player player, ref int buffIndex)
}
if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("StardustSquid"), 0, 0f, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("StardustSquid"), 0, 0f, player.whoAmI, 0f, 0f);
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion Buffs/TremorBuffs.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using Terraria;
using Terraria.ModLoader;

namespace Tremor.Buffs
{
public class TremorBuffs : GlobalBuff
{

public override void Update(int type, Terraria.Player player, ref int buffIndex)
public override void Update(int type, Player player, ref int buffIndex)
{
if (player.FindBuffIndex(117) != -1)
{
Expand Down
2 changes: 1 addition & 1 deletion Buffs/VortexBeeBuff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public override void Update(Player player, ref int buffIndex)
}
if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("VortexBee"), 0, 0f, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("VortexBee"), 0, 0f, player.whoAmI, 0f, 0f);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Buffs/WarkeeBuff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public override void Update(Player player, ref int buffIndex)
}
if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("Warkee"), 0, 0f, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("Warkee"), 0, 0f, player.whoAmI, 0f, 0f);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Buffs/ZootalooBuff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public override void Update(Player player, ref int buffIndex)
}
if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("ZootalooPet"), 0, 0f, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("ZootalooPet"), 0, 0f, player.whoAmI, 0f, 0f);
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions Buffs/petGenie.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Terraria;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;

namespace Tremor.Buffs
Expand All @@ -11,7 +12,7 @@ public override void SetDefaults()
{
DisplayName.SetDefault("Genie");
Description.SetDefault("A Genie follows you and shows location of enemies");
Main.buffNoTimeDisplay[this.Type] = true;
Main.buffNoTimeDisplay[Type] = true;
}

public override void Update(Player player, ref int buffIndex)
Expand All @@ -20,7 +21,7 @@ public override void Update(Player player, ref int buffIndex)
{
if (npc.friendly || npc.lifeMax <= 5 || !npc.active || npc.Distance(player.position) > 750)
continue;
Lighting.AddLight(npc.Center, new Microsoft.Xna.Framework.Vector3(0, 0, 1));
Lighting.AddLight(npc.Center, new Vector3(0, 0, 1));
}
if (MyDzhin == -1)
MyDzhin = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, mod.ProjectileType("projGenie"), 0, 0, 0);
Expand Down
2 changes: 1 addition & 1 deletion CustomDrop.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using Terraria.ModLoader;

namespace Tremor
{
Expand Down
17 changes: 9 additions & 8 deletions CustomWorldData.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Terraria;

namespace Tremor
Expand All @@ -13,7 +14,7 @@ public static class CustomWorldData
public static Dictionary<string, bool> Switch = new Dictionary<string, bool>();
public static Dictionary<string, string> String = new Dictionary<string, string>();

public static string WorldName { get { return Main.worldPathName.Split(new char[] { '/', '\\' })[Main.worldPathName.Split(new char[] { '/', '\\' }).Length - 1].Remove(Main.worldPathName.Split(new char[] { '/', '\\' })[Main.worldPathName.Split(new char[] { '/', '\\' }).Length - 1].Length - 4); } }
public static string WorldName => Main.worldPathName.Split('/', '\\')[Main.worldPathName.Split('/', '\\').Length - 1].Remove(Main.worldPathName.Split('/', '\\')[Main.worldPathName.Split('/', '\\').Length - 1].Length - 4);
public static string LastLoadedWorld = "";

public static void SetNumber(string Key, float Value)
Expand Down Expand Up @@ -82,7 +83,7 @@ public static void Save(bool Nu, bool Sw = false, bool St = false)
{
string FileName = Main.WorldPath + "\\" + WorldName + ".tnu";
FileStream FS = new FileStream(FileName, FileMode.Create);
StreamWriter SW = new StreamWriter(FS, System.Text.Encoding.Default);
StreamWriter SW = new StreamWriter(FS, Encoding.Default);
foreach (string Key in Number.Keys)
SW.WriteLine(Key + SpaceChar + Number[Key]);
SW.Close();
Expand All @@ -92,7 +93,7 @@ public static void Save(bool Nu, bool Sw = false, bool St = false)
{
string FileName = Main.WorldPath + "\\" + WorldName + ".tsw";
FileStream FS = new FileStream(FileName, FileMode.Create);
StreamWriter SW = new StreamWriter(FS, System.Text.Encoding.Default);
StreamWriter SW = new StreamWriter(FS, Encoding.Default);
foreach (string Key in Switch.Keys)
SW.WriteLine(Key + SpaceChar + Switch[Key]);
SW.Close();
Expand All @@ -102,7 +103,7 @@ public static void Save(bool Nu, bool Sw = false, bool St = false)
{
string FileName = Main.WorldPath + "\\" + WorldName + ".tst";
FileStream FS = new FileStream(FileName, FileMode.Create);
StreamWriter SW = new StreamWriter(FS, System.Text.Encoding.Default);
StreamWriter SW = new StreamWriter(FS, Encoding.Default);
foreach (string Key in String.Keys)
SW.WriteLine(Key + SpaceChar + String[Key]);
SW.Close();
Expand All @@ -120,7 +121,7 @@ public static void Load(bool Nu, bool Sw = false, bool St = false)
{
string FileName = Main.WorldPath + "\\" + WorldName + ".tnu";
FileStream FS = new FileStream(FileName, FileMode.OpenOrCreate);
StreamReader SR = new StreamReader(FS, System.Text.Encoding.Default);
StreamReader SR = new StreamReader(FS, Encoding.Default);
while (!SR.EndOfStream)
{
try
Expand All @@ -137,7 +138,7 @@ public static void Load(bool Nu, bool Sw = false, bool St = false)
{
string FileName = Main.WorldPath + "\\" + WorldName + ".tsw";
FileStream FS = new FileStream(FileName, FileMode.OpenOrCreate);
StreamReader SR = new StreamReader(FS, System.Text.Encoding.Default);
StreamReader SR = new StreamReader(FS, Encoding.Default);
while (!SR.EndOfStream)
{
try
Expand All @@ -154,7 +155,7 @@ public static void Load(bool Nu, bool Sw = false, bool St = false)
{
string FileName = Main.WorldPath + "\\" + WorldName + ".tst";
FileStream FS = new FileStream(FileName, FileMode.OpenOrCreate);
StreamReader SR = new StreamReader(FS, System.Text.Encoding.Default);
StreamReader SR = new StreamReader(FS, Encoding.Default);
while (!SR.EndOfStream)
{
try
Expand Down
Loading

0 comments on commit 613aa4c

Please sign in to comment.