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

Commit

Permalink
Initial Tremor, version 1.3.1.15
Browse files Browse the repository at this point in the history
  • Loading branch information
Jofairden committed Jul 11, 2017
1 parent dbffbb7 commit d7e719a
Show file tree
Hide file tree
Showing 7,107 changed files with 186,745 additions and 2 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
90 changes: 90 additions & 0 deletions AlchemistGlobalItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Tremor
{
public class AlchemistGlobalItem : GlobalItem
{
public override bool ConsumeItem(Item item, Player player)
{
MPlayer modPlayer = player.GetModPlayer<MPlayer>(mod);
if (modPlayer.novaChestplate)
{
if (player.FindBuffIndex(mod.BuffType("SuperFlask")) != -1)
{
if ((item.type == mod.ItemType("LesserManaFlask") || item.type == mod.ItemType("BurningFlask") || item.type == mod.ItemType("BoomFlask") || item.type == mod.ItemType("BigVenomFlask") || item.type == mod.ItemType("BigPoisonFlask") || item.type == mod.ItemType("BigManaFlask") ||
item.type == mod.ItemType("BigHealingFlack") || item.type == mod.ItemType("BasicFlask") || item.type == mod.ItemType("FreezeFlask") ||
item.type == mod.ItemType("DepressionFlask") || item.type == mod.ItemType("CrystalFlask") || item.type == mod.ItemType("ClusterFlask") ||
item.type == mod.ItemType("GoldFlask") || item.type == mod.ItemType("ExtendedFreezeFlask") || item.type == mod.ItemType("ExtendedBurningFlask") ||
item.type == mod.ItemType("ExtendedBoomFlask") || item.type == mod.ItemType("HealthSupportFlask") || item.type == mod.ItemType("ManaSupportFlask") ||
item.type == mod.ItemType("LesserVenomFlask") || item.type == mod.ItemType("LesserPoisonFlask") || item.type == mod.ItemType("LesserHealingFlack") ||
item.type == mod.ItemType("PlagueFlask") || item.type == mod.ItemType("PhantomFlask") || item.type == mod.ItemType("MoonDustFlask") ||
item.type == mod.ItemType("SparkingFlask") || item.type == mod.ItemType("SuperManaFlask") || item.type == mod.ItemType("SuperHealingFlask") || item.type == mod.ItemType("NovaFlask")) && Main.rand.NextFloat() < 0.65f)
{
return false;
}
}
if (player.FindBuffIndex(mod.BuffType("SuperFlaskBig")) != -1)
{
if ((item.type == mod.ItemType("LesserManaFlask") || item.type == mod.ItemType("BurningFlask") || item.type == mod.ItemType("BoomFlask") || item.type == mod.ItemType("BigVenomFlask") || item.type == mod.ItemType("BigPoisonFlask") || item.type == mod.ItemType("BigManaFlask") ||
item.type == mod.ItemType("BigHealingFlack") || item.type == mod.ItemType("BasicFlask") || item.type == mod.ItemType("FreezeFlask") ||
item.type == mod.ItemType("DepressionFlask") || item.type == mod.ItemType("CrystalFlask") || item.type == mod.ItemType("ClusterFlask") ||
item.type == mod.ItemType("GoldFlask") || item.type == mod.ItemType("ExtendedFreezeFlask") || item.type == mod.ItemType("ExtendedBurningFlask") ||
item.type == mod.ItemType("ExtendedBoomFlask") || item.type == mod.ItemType("HealthSupportFlask") || item.type == mod.ItemType("ManaSupportFlask") ||
item.type == mod.ItemType("LesserVenomFlask") || item.type == mod.ItemType("LesserPoisonFlask") || item.type == mod.ItemType("LesserHealingFlack") ||
item.type == mod.ItemType("PlagueFlask") || item.type == mod.ItemType("PhantomFlask") || item.type == mod.ItemType("MoonDustFlask") ||
item.type == mod.ItemType("SparkingFlask") || item.type == mod.ItemType("SuperManaFlask") || item.type == mod.ItemType("SuperHealingFlask") || item.type == mod.ItemType("NovaFlask")) && Main.rand.NextFloat() < 0.85f)
{
return false;
}
}
if (player.FindBuffIndex(mod.BuffType("SuperFlaskBig")) < 1 && player.FindBuffIndex(mod.BuffType("SuperFlaskBig")) < 1)
{
if ((item.type == mod.ItemType("LesserManaFlask") || item.type == mod.ItemType("BurningFlask") || item.type == mod.ItemType("BoomFlask") || item.type == mod.ItemType("BigVenomFlask") || item.type == mod.ItemType("BigPoisonFlask") || item.type == mod.ItemType("BigManaFlask") ||
item.type == mod.ItemType("BigHealingFlack") || item.type == mod.ItemType("BasicFlask") || item.type == mod.ItemType("FreezeFlask") ||
item.type == mod.ItemType("DepressionFlask") || item.type == mod.ItemType("CrystalFlask") || item.type == mod.ItemType("ClusterFlask") ||
item.type == mod.ItemType("GoldFlask") || item.type == mod.ItemType("ExtendedFreezeFlask") || item.type == mod.ItemType("ExtendedBurningFlask") ||
item.type == mod.ItemType("ExtendedBoomFlask") || item.type == mod.ItemType("HealthSupportFlask") || item.type == mod.ItemType("ManaSupportFlask") ||
item.type == mod.ItemType("LesserVenomFlask") || item.type == mod.ItemType("LesserPoisonFlask") || item.type == mod.ItemType("LesserHealingFlack") ||
item.type == mod.ItemType("PlagueFlask") || item.type == mod.ItemType("PhantomFlask") || item.type == mod.ItemType("MoonDustFlask") ||
item.type == mod.ItemType("SparkingFlask") || item.type == mod.ItemType("SuperManaFlask") || item.type == mod.ItemType("SuperHealingFlask") || item.type == mod.ItemType("NovaFlask")) && Main.rand.NextFloat() < 0.4f)
{
return false;
}
}
}
if (player.FindBuffIndex(mod.BuffType("SuperFlask")) != -1)
{
if ((item.type == mod.ItemType("LesserManaFlask") || item.type == mod.ItemType("BurningFlask") || item.type == mod.ItemType("BoomFlask") || item.type == mod.ItemType("BigVenomFlask") || item.type == mod.ItemType("BigPoisonFlask") || item.type == mod.ItemType("BigManaFlask") ||
item.type == mod.ItemType("BigHealingFlack") || item.type == mod.ItemType("BasicFlask") || item.type == mod.ItemType("FreezeFlask") ||
item.type == mod.ItemType("DepressionFlask") || item.type == mod.ItemType("CrystalFlask") || item.type == mod.ItemType("ClusterFlask") ||
item.type == mod.ItemType("GoldFlask") || item.type == mod.ItemType("ExtendedFreezeFlask") || item.type == mod.ItemType("ExtendedBurningFlask") ||
item.type == mod.ItemType("ExtendedBoomFlask") || item.type == mod.ItemType("HealthSupportFlask") || item.type == mod.ItemType("ManaSupportFlask") ||
item.type == mod.ItemType("LesserVenomFlask") || item.type == mod.ItemType("LesserPoisonFlask") || item.type == mod.ItemType("LesserHealingFlack") ||
item.type == mod.ItemType("PlagueFlask") || item.type == mod.ItemType("PhantomFlask") || item.type == mod.ItemType("MoonDustFlask") ||
item.type == mod.ItemType("SparkingFlask") || item.type == mod.ItemType("SuperManaFlask") || item.type == mod.ItemType("SuperHealingFlask") || item.type == mod.ItemType("NovaFlask")) && Main.rand.NextFloat() < 0.25f)
{
return false;
}
}
if (player.FindBuffIndex(mod.BuffType("SuperFlaskBig")) != -1 && modPlayer.novaAura)
{
if ((item.type == mod.ItemType("LesserManaFlask") || item.type == mod.ItemType("BurningFlask") || item.type == mod.ItemType("BoomFlask") || item.type == mod.ItemType("BigVenomFlask") || item.type == mod.ItemType("BigPoisonFlask") || item.type == mod.ItemType("BigManaFlask") ||
item.type == mod.ItemType("BigHealingFlack") || item.type == mod.ItemType("BasicFlask") || item.type == mod.ItemType("FreezeFlask") ||
item.type == mod.ItemType("DepressionFlask") || item.type == mod.ItemType("CrystalFlask") || item.type == mod.ItemType("ClusterFlask") ||
item.type == mod.ItemType("GoldFlask") || item.type == mod.ItemType("ExtendedFreezeFlask") || item.type == mod.ItemType("ExtendedBurningFlask") ||
item.type == mod.ItemType("ExtendedBoomFlask") || item.type == mod.ItemType("HealthSupportFlask") || item.type == mod.ItemType("ManaSupportFlask") ||
item.type == mod.ItemType("LesserVenomFlask") || item.type == mod.ItemType("LesserPoisonFlask") || item.type == mod.ItemType("LesserHealingFlack") ||
item.type == mod.ItemType("PlagueFlask") || item.type == mod.ItemType("PhantomFlask") || item.type == mod.ItemType("MoonDustFlask") ||
item.type == mod.ItemType("SparkingFlask") || item.type == mod.ItemType("SuperManaFlask") || item.type == mod.ItemType("SuperHealingFlask") || item.type == mod.ItemType("NovaFlask")) && Main.rand.NextFloat() < 0.45f)
{
return false;
}
}
return base.ConsumeItem(item, player);
}
}
}
91 changes: 91 additions & 0 deletions AlchemistItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using System.Linq;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;

namespace Tremor
{
public abstract class AlchemistItem : ModItem
{

public override void ModifyTooltips(System.Collections.Generic.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";
}

if (tooltips[i].Name == "CritChance")
{
MPlayer mp = Main.LocalPlayer.GetModPlayer<MPlayer>(mod);
tooltips[i].text = ((int)(item.crit + mp.alchemistCrit)).ToString() + "% 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");
tooltips.Insert(2, tip);
}

public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
MPlayer modPlayer = player.GetModPlayer<MPlayer>(mod);
if (modPlayer.glove)
{
for (int i = 0; i < 1; ++i)
{
if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1)
{
Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer);
Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, 297, damage, knockBack, Main.myPlayer);
}
if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1)
{
Projectile.NewProjectile(position.X, position.Y, speedX + 3, speedY + 3, 297, damage, knockBack, Main.myPlayer);
Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer);
Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, 297, damage, knockBack, Main.myPlayer);
Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 2, 297, damage, knockBack, Main.myPlayer);
}
Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer);
int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer);
Main.projectile[k].friendly = true;
}
return false;
}
if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1 && !modPlayer.glove)
{
for (int i = 0; i < 1; ++i)
{
Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer);
int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer);
Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, 297, damage, knockBack, Main.myPlayer);
Main.projectile[k].friendly = true;
}
return false;
}
if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1 && !modPlayer.glove)
{
for (int i = 0; i < 1; ++i)
{
Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer);
Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer);
int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer);
Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, 297, damage, knockBack, Main.myPlayer);
Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 2, 297, damage, knockBack, Main.myPlayer);
Main.projectile[k].friendly = true;
}
return false;
}
return true;
}
}
}
52 changes: 52 additions & 0 deletions Angle.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System;

namespace Tremor
{
public struct Angle
{
public float Value;
public Angle(float angle)
{
Value = angle;
float remainder = Value % (2f * (float)Math.PI);
float rotations = Value - remainder;
Value -= rotations;
if(Value < 0f)
{
Value += 2f * (float)Math.PI;
}
}

public static Angle operator +(Angle a1, Angle a2)
{
return new Angle(a1.Value + a2.Value);
}

public static Angle operator -(Angle a1, Angle a2)
{
return new Angle(a1.Value - a2.Value);
}

public Angle Opposite()
{
return new Angle(Value + (float)Math.PI);
}

public bool ClockwiseFrom(Angle other)
{
if(other.Value >= (float)Math.PI)
{
return this.Value < other.Value && this.Value >= other.Opposite().Value;
}
return this.Value < other.Value || this.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 this.Value >= cLimit.Value || this.Value <= ccLimit.Value;
}
}}
17 changes: 17 additions & 0 deletions Buffs/AlchemistGloveBuff.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using Terraria;
using Terraria.ModLoader;

namespace Tremor.Buffs
{
public class AlchemistGloveBuff : ModBuff
{
public override void SetDefaults()
{
DisplayName.SetDefault("Master Alchemist Glove");
Description.SetDefault("Alchemic weapons throw two flasks");
Main.buffNoSave[Type] = true;
Main.buffNoTimeDisplay[Type] = true;
}
}
}
Binary file added Buffs/AlchemistGloveBuff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions Buffs/AmplifiedEnchantmentSolution.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using Terraria;
using Terraria.ModLoader;

namespace Tremor.Buffs
{
public class AmplifiedEnchantmentSolution : ModBuff
{
public override void SetDefaults()
{
DisplayName.SetDefault("Amplified Enchantment Solution");
Description.SetDefault("45% chance not to consume flask");
Main.buffNoSave[Type] = true;
Main.buffNoTimeDisplay[Type] = true;
}
}
}
Binary file added Buffs/AmplifiedEnchantmentSolution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions Buffs/AncientBannerBuff.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using Terraria;
using Terraria.ModLoader;

namespace Tremor.Buffs
{
public class AncientBannerBuff : ModBuff
{
public override void SetDefaults()
{
DisplayName.SetDefault("The Ancient Banner");
Description.SetDefault("Increased life regeneration");
Main.buffNoSave[Type] = true;
Main.buffNoTimeDisplay[Type] = true;
}

public override void Update(Player player, ref int buffIndex)
{
player.lifeRegen += 40;
}
}
}
Binary file added Buffs/AncientBannerBuff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions Buffs/AncientPredatorBuff.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using Terraria;
using Terraria.ModLoader;

namespace Tremor.Buffs
{
public class AncientPredatorBuff : ModBuff
{
int MinionType = -1;
int MinionID = -1;

public override void SetDefaults()
{
DisplayName.SetDefault("The Ancient Predator");
Description.SetDefault("The ancient predator defends you");
Main.buffNoSave[Type] = true;
Main.buffNoTimeDisplay[Type] = true;
}


public override void Update(Player player, ref int buffIndex)
{
if (MinionType == -1)
MinionType = mod.ProjectileType("AncientPredator");
if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI)
{
Projectile proj = new Projectile();
proj.SetDefaults(MinionType);
MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, 300, 3, player.whoAmI);
}
else
{
Main.projectile[MinionID].timeLeft = 5;
}
}
}
}
Binary file added Buffs/AncientPredatorBuff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions Buffs/AncientVisionBuff.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using Terraria;
using Terraria.ModLoader;

namespace Tremor.Buffs
{
public class AncientVisionBuff : ModBuff
{
public override void SetDefaults()
{
DisplayName.SetDefault("Ancient Vision");
Description.SetDefault("The ancient vision will fight for you");
Main.buffNoSave[Type] = true;
Main.buffNoTimeDisplay[Type] = true;
}

public override void Update(Player player, ref int buffIndex)
{
TremorPlayer modPlayer = (TremorPlayer)player.GetModPlayer(mod, "TremorPlayer");
if (player.ownedProjectileCounts[mod.ProjectileType("AncientVisionPro")] > 0)
{
modPlayer.ancientVision = true;
}
if (!modPlayer.ancientVision)
{
player.DelBuff(buffIndex);
buffIndex--;
}
else
{
player.buffTime[buffIndex] = 18000;
}
}
}
}
Binary file added Buffs/AncientVisionBuff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d7e719a

Please sign in to comment.