Organized projectiles.

Updated The Mind trinity item.
This commit is contained in:
FyloZ 2020-07-14 22:31:26 -04:00
parent df5b7c2b43
commit 0cf76d5270
78 changed files with 262 additions and 218 deletions

View File

@ -1,4 +1,5 @@
using Decimation.Content.Projectiles;
using Decimation.Content.Projectiles.Item.Weapon;
using Decimation.Lib.Buffs;
using Microsoft.Xna.Framework;
using Terraria;

View File

@ -2,6 +2,7 @@
using System.Collections.Generic;
using Decimation.Content.Buffs.Buffs;
using Decimation.Content.Items.Accessories;
using Decimation.Content.Items.Accessories.Trinity;
using Decimation.Content.Items.Amulets;
using Decimation.Content.Items.Misc;
using Decimation.Lib.Amulets;
@ -9,6 +10,7 @@ using Decimation.Lib.Collections;
using Decimation.Lib.Util;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.GameInput;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

View File

@ -1,15 +1,12 @@
using System.IO;
using System.Collections.Generic;
using Terraria;
using Terraria.ModLoader;
using Terraria.World.Generation;
using Terraria.GameContent.Generation;
using Terraria.ModLoader.IO;
using System.IO;
using Decimation.Content.Projectiles.Boss.DuneWyrm;
using Decimation.Content.Structures;
using Microsoft.Xna.Framework;
using System;
using Decimation.Content.Projectiles.DuneWyrm;
using Terraria.ID;
using Terraria;
using Terraria.GameContent.Generation;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;
using Terraria.World.Generation;
namespace Decimation.Content
{
@ -72,19 +69,19 @@ namespace Decimation.Content
if (loadVersion == 1)
{
byte flags = reader.ReadByte();
DecimationWorld.downedBloodshotEye = ((flags & 1) != 0);
DecimationWorld.downedDuneWyrm = ((flags & 2) != 0); //double flag numbers with each new boss
DecimationWorld.downedArachnus = ((flags & 4) != 0);
DecimationWorld.downedWyvern = ((flags & 8) != 0);
downedBloodshotEye = ((flags & 1) != 0);
downedDuneWyrm = ((flags & 2) != 0); //double flag numbers with each new boss
downedArachnus = ((flags & 4) != 0);
downedWyvern = ((flags & 8) != 0);
}
else if (loadVersion == 2)
{
byte flags = reader.ReadByte();
byte flags2 = reader.ReadByte();
DecimationWorld.downedBloodshotEye = ((flags & 1) != 0);
DecimationWorld.downedDuneWyrm = ((flags & 2) != 0);
DecimationWorld.downedArachnus = ((flags & 4) != 0);
DecimationWorld.downedWyvern = ((flags & 8) != 0);
downedBloodshotEye = ((flags & 1) != 0);
downedDuneWyrm = ((flags & 2) != 0);
downedArachnus = ((flags & 4) != 0);
downedWyvern = ((flags & 8) != 0);
}
}

View File

@ -43,28 +43,12 @@ namespace Decimation.Content.Items.Accessories.Trinity
overrideColor = ChatManager.WaveColor(Color.Red)
});
}
}
class BodyProjectileEffects : GlobalProjectile
{
public override void ModifyHitPvp(Projectile projectile, Player target, ref int damage, ref bool crit)
{
Ricochet(projectile, target, true, ref damage);
}
public override void ModifyHitPlayer(Projectile projectile, Player target, ref int damage, ref bool crit)
{
if (Ricochet(projectile, target, false, ref damage))
{
projectile.hostile = false;
projectile.friendly = true;
}
}
private bool Ricochet(Projectile projectile, Player player, bool fromPlayer, ref int damage)
public static bool BodyEffect(Projectile projectile, Player player, bool fromPlayer, ref int damage)
{
if (Main.expertMode && Main.rand.NextBool(10) &&
player.GetModPlayer().HasEquippedAccessory(ModContent.ItemType<Body>()))
(player.GetModPlayer().HasEquippedAccessory(ModContent.ItemType<Body>()) ||
player.GetModPlayer().HasEquippedAccessory(ModContent.ItemType<Trinity>())))
{
return projectile.Richochet(player, fromPlayer, ref damage);
}
@ -72,4 +56,21 @@ namespace Decimation.Content.Items.Accessories.Trinity
return false;
}
}
class BodyProjectileEffects : GlobalProjectile
{
public override void ModifyHitPvp(Projectile projectile, Player target, ref int damage, ref bool crit)
{
Body.BodyEffect(projectile, target, true, ref damage);
}
public override void ModifyHitPlayer(Projectile projectile, Player target, ref int damage, ref bool crit)
{
if (Body.BodyEffect(projectile, target, false, ref damage))
{
projectile.hostile = false;
projectile.friendly = true;
}
}
}
}

View File

@ -1,8 +1,8 @@
using System.Collections.Generic;
using Decimation.Content.Projectiles.Item.Accessory.Trinity;
using Decimation.Lib.Util;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.UI.Chat;
@ -10,13 +10,17 @@ namespace Decimation.Content.Items.Accessories.Trinity
{
public class Mind : TrinityAccessory
{
private static readonly float TrinityBeamSpeed = 8f;
private static readonly int TrinityBeamDamage = 35;
protected override string ItemName => "The Mind";
protected override string ItemTooltip => "I know all...\n" +
"Increases block placement and mining speed by 10%\n" +
"Increases ranged and thrown damage by 10%\n" +
"Increases ranged and thrown critical hit chances by 10%\n" +
"Allows you to see nearby danger sources\n" +
"Shows the location of treasure and ore";
"Increases view range\n" +
"Melee attacks have 4% chance to fire a Trinity Beam";
protected override void InitAccessory()
{
@ -35,9 +39,7 @@ namespace Decimation.Content.Items.Accessories.Trinity
player.rangedCrit = (int) (player.rangedCrit * 1.10f);
player.thrownDamage *= 1.10f;
player.thrownCrit = (int) (player.thrownCrit * 1.10f);
player.AddBuff(BuffID.Spelunker, 1);
player.AddBuff(BuffID.Dangersense, 1);
player.scope = true;
base.UpdateAccessory(player, hideVisual);
}
@ -49,5 +51,73 @@ namespace Decimation.Content.Items.Accessories.Trinity
overrideColor = ChatManager.WaveColor(Color.Yellow)
});
}
public static void MindEffect(Player player, Entity target)
{
if (Main.rand.NextBool(25) && (player.HasEquippedAccessory(ModContent.ItemType<Mind>()) || player.HasEquippedAccessory(ModContent.ItemType<Trinity>())))
{
bool targetIsPlayer = target.GetType() == typeof(Player);
// Target
Entity projTarget = null;
float lastDistance = float.MaxValue;
if (targetIsPlayer)
{
for (int p = 0; p < Main.player.Length; p++)
{
Player playerTarget = Main.player[p];
if (playerTarget != null)
{
float distance = playerTarget.Distance(target.position);
if (playerTarget.active && !playerTarget.dead &&
playerTarget.whoAmI != player.whoAmI && playerTarget.whoAmI != target.whoAmI &&
distance < 1000f && distance < lastDistance)
{
projTarget = playerTarget;
lastDistance = distance;
}
}
}
}
for (int n = 0; n < Main.npc.Length; n++)
{
NPC npcTarget = Main.npc[n];
if (npcTarget != null)
{
float distance = npcTarget.Distance(target.position);
if (npcTarget.active && !npcTarget.friendly && (targetIsPlayer || npcTarget.whoAmI != target.whoAmI) &&
distance < 1000f && distance < lastDistance)
{
projTarget = npcTarget;
lastDistance = distance;
}
}
}
if (projTarget != null)
{
Vector2 velocity = projTarget.Center - target.Center;
velocity.Normalize();
velocity *= TrinityBeamSpeed;
Projectile.NewProjectile(target.Center, velocity, ModContent.ProjectileType<TrinityBeam>(), TrinityBeamDamage, 2f,
player.whoAmI);
}
}
}
}
class MindItemEffects : GlobalItem
{
public override void OnHitNPC(Item item, Player player, NPC target, int damage, float knockBack, bool crit)
{
Mind.MindEffect(player, target);
}
public override void OnHitPvp(Item item, Player player, Player target, int damage, bool crit)
{
Mind.MindEffect(player, target);
}
}
}

View File

@ -45,24 +45,36 @@ namespace Decimation.Content.Items.Accessories.Trinity
overrideColor = ChatManager.WaveColor(Color.Blue)
});
}
}
class SoulItemEffects : GlobalItem
{
public override void OnHitNPC(Item item, Player player, NPC target, int damage, float knockBack, bool crit)
public static void SoulHitEffect(Player target, ref int damage)
{
DecimationPlayer targetModPlayer = target.GetModPlayer();
if (Main.rand.NextBool(10) && (targetModPlayer.HasEquippedAccessory(ModContent.ItemType<Soul>()) || targetModPlayer.HasEquippedAccessory(ModContent.ItemType<Trinity>())))
{
damage = 0;
targetModPlayer.NextHitCrit = true;
}
}
public static void SoulEffect(Player player, Entity target, bool crit)
{
if (crit && player.GetModPlayer().HasEquippedAccessory(ModContent.ItemType<Soul>()))
{
player.LeechMana(target);
}
}
}
class SoulItemEffects : GlobalItem
{
public override void OnHitNPC(Item item, Player player, NPC target, int damage, float knockBack, bool crit)
{
Soul.SoulEffect(player, target, crit);
}
public override void OnHitPvp(Item item, Player player, Player target, int damage, bool crit)
{
if (crit && player.GetModPlayer().HasEquippedAccessory(ModContent.ItemType<Soul>()))
{
player.LeechMana(target);
}
Soul.SoulEffect(player, target, crit);
}
}
@ -71,41 +83,29 @@ namespace Decimation.Content.Items.Accessories.Trinity
public override void OnHitNPC(Projectile projectile, NPC target, int damage, float knockback, bool crit)
{
Player owner = Main.player[projectile.owner];
if (crit && owner != null && owner.active && !owner.dead &&
owner.GetModPlayer().HasEquippedAccessory(ModContent.ItemType<Soul>()))
if (owner != null && owner.active && !owner.dead)
{
owner.LeechMana(target);
Soul.SoulEffect(owner, target, crit);
}
}
public override void OnHitPvp(Projectile projectile, Player target, int damage, bool crit)
{
Player owner = Main.player[projectile.owner];
if (crit && owner != null && owner.active && !owner.dead &&
owner.GetModPlayer().HasEquippedAccessory(ModContent.ItemType<Soul>()))
if (owner != null && owner.active && !owner.dead)
{
owner.LeechMana(target);
Soul.SoulEffect(owner, target, crit);
}
}
public override void ModifyHitPvp(Projectile projectile, Player target, ref int damage, ref bool crit)
{
IgnoreHit(target, ref damage);
Soul.SoulHitEffect(target, ref damage);
}
public override void ModifyHitPlayer(Projectile projectile, Player target, ref int damage, ref bool crit)
{
IgnoreHit(target, ref damage);
}
private void IgnoreHit(Player target, ref int damage)
{
DecimationPlayer targetModPlayer = target.GetModPlayer();
if (Main.rand.NextBool(10) && targetModPlayer.HasEquippedAccessory(ModContent.ItemType<Soul>()))
{
damage = 0;
targetModPlayer.NextHitCrit = true;
}
Soul.SoulHitEffect(target, ref damage);
}
}
}

View File

@ -1,8 +1,6 @@
using System.Collections.Generic;
using Decimation.Lib.Util;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.UI.Chat;
@ -18,8 +16,8 @@ namespace Decimation.Content.Items.Accessories.Trinity
"Increases all damage by 10%\n" +
"Increases all critical hit chances by 10%\n" +
"Increases minions knockback by 10%\n" +
"Allows you to see nearby danger sources\n" +
"Shows the location of treasure and ore\n" +
"Increases view range\n" +
"Melee attacks have 4% chance to fire a Trinity Beam\n" +
"Criticals hits leech mana\n" +
"Hostile projectiles have 10% chance to phase through you,\nnegating all damage and causing your next attack to be a critical hit\n" +
"Hostile projectiles have 10% chance to ricochet off you\nand target your enemies with 50% increased damage";
@ -53,9 +51,9 @@ namespace Decimation.Content.Items.Accessories.Trinity
player.rangedCrit = (int) (player.rangedCrit * 1.10f);
player.thrownDamage *= 1.10f;
player.thrownCrit = (int) (player.thrownCrit * 1.10f);
player.scope = true;
player.AddBuff(BuffID.Spelunker, 1);
player.AddBuff(BuffID.Dangersense, 1);
base.UpdateAccessory(player, hideVisual);
}
public override void ModifyTooltips(List<TooltipLine> tooltips)
@ -66,84 +64,4 @@ namespace Decimation.Content.Items.Accessories.Trinity
});
}
}
class TrinityItemEffects : GlobalItem
{
public override void OnHitNPC(Item item, Player player, NPC target, int damage, float knockBack, bool crit)
{
if (crit && player.GetModPlayer().HasEquippedAccessory(ModContent.ItemType<Trinity>()))
{
player.LeechMana(target);
}
}
public override void OnHitPvp(Item item, Player player, Player target, int damage, bool crit)
{
if (crit && player.GetModPlayer().HasEquippedAccessory(ModContent.ItemType<Trinity>()))
{
player.LeechMana(target);
}
}
}
class TrinityProjectileEffects : GlobalProjectile
{
public override void OnHitNPC(Projectile projectile, NPC target, int damage, float knockback, bool crit)
{
Player owner = Main.player[projectile.owner];
if (crit && owner != null && owner.active && !owner.dead &&
owner.GetModPlayer().HasEquippedAccessory(ModContent.ItemType<Trinity>()))
{
owner.LeechMana(target);
}
}
public override void OnHitPvp(Projectile projectile, Player target, int damage, bool crit)
{
Player owner = Main.player[projectile.owner];
if (crit && owner != null && owner.active && !owner.dead &&
owner.GetModPlayer().HasEquippedAccessory(ModContent.ItemType<Trinity>()))
{
owner.LeechMana(target);
}
}
public override void ModifyHitPvp(Projectile projectile, Player target, ref int damage, ref bool crit)
{
Ricochet(projectile, target, true, ref damage);
IgnoreHit(target, ref damage);
}
public override void ModifyHitPlayer(Projectile projectile, Player target, ref int damage, ref bool crit)
{
if (Ricochet(projectile, target, false, ref damage))
{
projectile.hostile = false;
projectile.friendly = true;
}
IgnoreHit(target, ref damage);
}
private bool Ricochet(Projectile projectile, Player player, bool fromPlayer, ref int damage)
{
if (Main.expertMode && Main.rand.NextBool(10) &&
player.GetModPlayer().HasEquippedAccessory(ModContent.ItemType<Trinity>()))
{
return projectile.Richochet(player, fromPlayer, ref damage);
}
return false;
}
private void IgnoreHit(Player target, ref int damage)
{
DecimationPlayer targetModPlayer = target.GetModPlayer();
if (Main.rand.NextBool(10) && targetModPlayer.HasEquippedAccessory(ModContent.ItemType<Soul>()))
{
damage = 0;
targetModPlayer.NextHitCrit = true;
}
}
}
}

View File

@ -13,7 +13,8 @@ namespace Decimation.Content.Items.Accessories.Trinity
{
return !player.HasEquippedAccessory(ModContent.ItemType<Body>()) &&
!player.HasEquippedAccessory(ModContent.ItemType<Soul>()) &&
!player.HasEquippedAccessory(ModContent.ItemType<Mind>());
!player.HasEquippedAccessory(ModContent.ItemType<Mind>()) &&
!player.HasEquippedAccessory(ModContent.ItemType<Trinity>());
}
public override bool? PrefixChance(int pre, UnifiedRandom rand)

View File

@ -1,7 +1,7 @@
using System.Collections.Generic;
using Decimation.Content.Items.Misc.CondensedSouls;
using Decimation.Content.Items.Ores;
using Decimation.Content.Projectiles;
using Decimation.Content.Projectiles.Item.Accessory;
using Decimation.Content.Tiles;
using Decimation.Lib.Items;
using Decimation.Lib.Util;

View File

@ -1,5 +1,6 @@
using Decimation.Content.Buffs.Debuffs;
using Decimation.Content.Projectiles;
using Decimation.Content.Projectiles.Boss.Arachnus;
using Decimation.Lib.Items;
using Terraria;
using Terraria.ID;

View File

@ -1,5 +1,6 @@
using Decimation.Content.Buffs.Debuffs;
using Decimation.Content.Projectiles;
using Decimation.Content.Projectiles.Boss.BloodshotEye;
using Decimation.Lib.Items;
using Decimation.Lib.Util;
using Terraria;

View File

@ -1,4 +1,5 @@
using Decimation.Content.Projectiles;
using Decimation.Content.Projectiles.Item.Weapon;
using Decimation.Lib.Items;
using Decimation.Lib.Util;
using Microsoft.Xna.Framework;

View File

@ -1,4 +1,5 @@
using Decimation.Content.Projectiles;
using Decimation.Content.Projectiles.Boss.BloodshotEye;
using Decimation.Lib.Items;
using Decimation.Lib.Util;
using Microsoft.Xna.Framework;

View File

@ -1,6 +1,6 @@
using System.Collections.Generic;
using Decimation.Content.Items.Misc.Souls;
using Decimation.Content.Projectiles.DuneWyrm;
using Decimation.Content.Projectiles.Boss.DuneWyrm;
using Decimation.Lib.Items;
using Decimation.Lib.Util;
using Decimation.Lib.Util.Builder;

View File

@ -15,7 +15,7 @@ namespace Decimation.Content.Items.Weapons.DuneWyrm
protected override string ItemTooltip => "Fire bolts of pure time to eradicate your opposition";
protected override int Damages => 15;
protected override DamageType DamagesType => DamageType.Magic;
protected override int ProjectileId => ModContent.ProjectileType<Projectiles.DuneWyrm.Sundial>();
protected override int ProjectileId => ModContent.ProjectileType<Projectiles.Boss.DuneWyrm.Sundial>();
protected override void InitWeapon()
{

View File

@ -16,7 +16,7 @@ namespace Decimation.Content.Items.Weapons.DuneWyrm
protected override string ItemTooltip => "Their time has come...";
protected override int Damages => 45;
protected override DamageType DamagesType => DamageType.Ranged;
protected override int ProjectileId => ModContent.ProjectileType<Projectiles.DuneWyrm.Timekeeper>();
protected override int ProjectileId => ModContent.ProjectileType<Projectiles.Boss.DuneWyrm.Timekeeper>();
protected override int AmmoId => AmmoID.Bullet;
protected override void InitWeapon()

View File

@ -1,6 +1,6 @@
using System.Collections.Generic;
using Decimation.Content.Items.Misc.Souls;
using Decimation.Content.Projectiles.DuneWyrm;
using Decimation.Content.Projectiles.Boss.DuneWyrm;
using Decimation.Lib.Items;
using Decimation.Lib.Util.Builder;
using Microsoft.Xna.Framework;

View File

@ -1,4 +1,4 @@
using Decimation.Content.Projectiles;
using Decimation.Content.Projectiles.Item.Weapon;
using Decimation.Lib.Items;
using Decimation.Lib.Util;
using Decimation.Lib.Util.Builder;

View File

@ -1,4 +1,4 @@
using Decimation.Content.Projectiles;
using Decimation.Content.Projectiles.Item.Weapon;
using Decimation.Lib.Items;
using Terraria.ModLoader;

View File

@ -1,12 +1,10 @@
using Decimation.Content.Projectiles;
using Decimation.Content.Projectiles.Item.Weapon;
using Decimation.Lib.Items;
using Decimation.Lib.Util;
using Decimation.Lib.Util.Builder;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
using SoundType = Terraria.ModLoader.SoundType;
namespace Decimation.Content.Items.Weapons
{

View File

@ -1,6 +1,6 @@
using Decimation.Content.Items.Ores;
using Decimation.Content.Items.Weapons.Arachnus;
using Decimation.Content.Projectiles;
using Decimation.Content.Projectiles.Item.Weapon;
using Decimation.Content.Tiles;
using Decimation.Lib.Items;
using Microsoft.Xna.Framework;

View File

@ -1,5 +1,5 @@
using Decimation.Content.Items.Ores;
using Decimation.Content.Projectiles;
using Decimation.Content.Projectiles.Item.Weapon;
using Decimation.Content.Tiles;
using Decimation.Lib.Items;
using Decimation.Lib.Util;

View File

@ -4,7 +4,7 @@ using Decimation.Content.Buffs.Debuffs;
using Decimation.Content.Items.Boss.Arachnus;
using Decimation.Content.Items.Misc.Souls;
using Decimation.Content.Items.Weapons.Arachnus;
using Decimation.Content.Projectiles;
using Decimation.Content.Projectiles.Boss.Arachnus;
using Decimation.Content.Tiles.ShrineoftheMoltenOne;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

View File

@ -4,6 +4,7 @@ using Decimation.Content.Items.Boss.Bloodshot;
using Decimation.Content.Items.Misc;
using Decimation.Content.Items.Weapons.Bloodshot;
using Decimation.Content.Projectiles;
using Decimation.Content.Projectiles.Boss.BloodshotEye;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;

View File

@ -4,14 +4,15 @@ using Decimation.Content.Buffs.Debuffs;
using Decimation.Content.Items.Boss.DuneWyrm;
using Decimation.Content.Items.Misc.Souls;
using Decimation.Content.Items.Vanity.DuneWyrm;
using Decimation.Content.NPCs.DuneWyrm.AncientTombCrawler;
using Decimation.Content.Projectiles;
using Decimation.Content.Projectiles.Boss.DuneWyrm;
using Decimation.Lib.NPCs;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using AncientTombCrawlerHead = Decimation.Content.NPCs.DuneWyrm.AncientTombCrawler.AncientTombCrawlerHead;
namespace Decimation.Content.NPCs.DuneWyrm
{

View File

@ -1,5 +1,6 @@
using Decimation.Content.Buffs.Debuffs;
using Decimation.Content.Projectiles;
using Decimation.Content.Projectiles.NPC;
using Decimation.Content.Tiles.ShrineoftheMoltenOne;
using Decimation.Lib.Util;
using Microsoft.Xna.Framework;

View File

@ -3,6 +3,7 @@ using Decimation.Content.Dusts;
using Decimation.Content.Items.Misc;
using Decimation.Content.NPCs.Bloodshot;
using Decimation.Content.Projectiles;
using Decimation.Content.Projectiles.NPC;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;

View File

@ -3,6 +3,7 @@ using Decimation.Content.Items.Boss.DuneWyrm;
using Decimation.Content.Items.Misc;
using Decimation.Content.Items.Misc.Souls;
using Decimation.Content.Projectiles;
using Decimation.Content.Projectiles.NPC;
using Decimation.Content.UI;
using Terraria;
using Terraria.ID;

View File

@ -4,7 +4,7 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.Boss.Arachnus
{
internal class ArachnusFireball : DecimationProjectile
{
@ -16,7 +16,7 @@ namespace Decimation.Content.Projectiles
this.projectile.light = 1f;
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
public override void OnHitNPC(Terraria.NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(ModContent.BuffType<Singed>(), 120);
}

View File

@ -2,7 +2,7 @@
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.Boss.Arachnus
{
internal class ArchingSolarBlade : DecimationProjectile
{

View File

Before

Width:  |  Height:  |  Size: 441 B

After

Width:  |  Height:  |  Size: 441 B

View File

@ -5,7 +5,7 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.Boss.Arachnus
{
internal class BlastofHeat : DecimationProjectile
{
@ -25,7 +25,7 @@ namespace Decimation.Content.Projectiles
projectile.extraUpdates = 3;
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
public override void OnHitNPC(Terraria.NPC target, int damage, float knockback, bool crit)
{
if (Main.rand.Next(2) == 0)
target.AddBuff(BuffID.OnFire, 600);

View File

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 207 B

View File

@ -4,7 +4,7 @@ using Terraria;
using Terraria.ID;
using Microsoft.Xna.Framework;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.Boss.Arachnus
{
internal class BlastofShadowFlame : DecimationProjectile
{
@ -91,7 +91,7 @@ namespace Decimation.Content.Projectiles
projectile.rotation += 0.3f * (float)projectile.direction;
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
public override void OnHitNPC(Terraria.NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(BuffID.ShadowFlame, Main.expertMode ? 360 : 600);
}

View File

Before

Width:  |  Height:  |  Size: 219 B

After

Width:  |  Height:  |  Size: 219 B

View File

@ -7,7 +7,7 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.Boss.Arachnus
{
internal class MoltenStyngerBolt : DecimationProjectile
{
@ -42,7 +42,7 @@ namespace Decimation.Content.Projectiles
return false;
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
public override void OnHitNPC(Terraria.NPC target, int damage, float knockback, bool crit)
{
if (projectile.timeLeft > 3)
projectile.timeLeft = 3;

View File

Before

Width:  |  Height:  |  Size: 309 B

After

Width:  |  Height:  |  Size: 309 B

View File

@ -11,7 +11,7 @@ using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.Boss.BloodshotEye
{
internal class BloodBeam : DecimationProjectile
{
@ -47,7 +47,7 @@ namespace Decimation.Content.Projectiles
int damages = Main.rand.Next(5, 11);
target.Hurt(PlayerDeathReason.LegacyDefault(), damages, 0);
NPC bloodshotEye = Main.npc[(int)projectile.ai[0]];
Terraria.NPC bloodshotEye = Main.npc[(int)projectile.ai[0]];
bloodshotEye.life += damages;
bloodshotEye.HealEffect(damages);
}

View File

@ -3,7 +3,7 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.Boss.BloodshotEye
{
internal class BloodBeamFriendly : DecimationProjectile
{

View File

@ -7,7 +7,7 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.Boss.BloodshotEye
{
internal class BloodClot : DecimationProjectile
{

View File

Before

Width:  |  Height:  |  Size: 288 B

After

Width:  |  Height:  |  Size: 288 B

View File

@ -5,7 +5,7 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.Boss.BloodshotEye
{
internal class BloodClotSmall : DecimationProjectile
{

View File

Before

Width:  |  Height:  |  Size: 246 B

After

Width:  |  Height:  |  Size: 246 B

View File

@ -5,7 +5,7 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.Boss.BloodshotEye
{
internal class Tooth : DecimationProjectile
{
@ -23,7 +23,7 @@ namespace Decimation.Content.Projectiles
DamageType = DecimationWeapon.DamageType.Ranged;
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
public override void OnHitNPC(Terraria.NPC target, int damage, float knockback, bool crit)
{
int regen = (int)(damage * 0.08f);
Player owner = Main.player[projectile.owner];

View File

Before

Width:  |  Height:  |  Size: 320 B

After

Width:  |  Height:  |  Size: 320 B

View File

@ -1,6 +1,6 @@
using Terraria.ID;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.Boss.DuneWyrm
{
internal class Ammonite : DecimationProjectile
{

View File

Before

Width:  |  Height:  |  Size: 534 B

After

Width:  |  Height:  |  Size: 534 B

View File

@ -3,7 +3,7 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria.ModLoader;
namespace Decimation.Content.Projectiles.DuneWyrm
namespace Decimation.Content.Projectiles.Boss.DuneWyrm
{
class AncientTombCrawlerHead : AncientTombCrawler
{

View File

@ -3,7 +3,7 @@ using Decimation.Lib.Util;
using Terraria;
using Terraria.ID;
namespace Decimation.Content.Projectiles.DuneWyrm
namespace Decimation.Content.Projectiles.Boss.DuneWyrm
{
public class HourHandProjectile : DecimationProjectile
{

View File

Before

Width:  |  Height:  |  Size: 828 B

After

Width:  |  Height:  |  Size: 828 B

View File

@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
namespace Decimation.Content.Projectiles.DuneWyrm
namespace Decimation.Content.Projectiles.Boss.DuneWyrm
{
public class Sundial : DecimationProjectile
{
@ -134,7 +134,7 @@ namespace Decimation.Content.Projectiles.DuneWyrm
}
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
public override void OnHitNPC(Terraria.NPC target, int damage, float knockback, bool crit)
{
if (Index == 1) target.AddBuff(BuffID.Slow, 300);
}

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -3,7 +3,7 @@ using Decimation.Lib.Items;
using Microsoft.Xna.Framework;
using Terraria;
namespace Decimation.Content.Projectiles.DuneWyrm
namespace Decimation.Content.Projectiles.Boss.DuneWyrm
{
public class Timekeeper : DecimationProjectile
{

View File

Before

Width:  |  Height:  |  Size: 256 B

After

Width:  |  Height:  |  Size: 256 B

View File

@ -1,12 +1,10 @@
using System;
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using Decimation.Content.Buffs.Buffs;
using Decimation.Content.Buffs.Debuffs;
using Decimation.Content.Buffs.Debuffs;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.Item.Accessory
{
internal class Ember : DecimationProjectile
{
@ -28,10 +26,10 @@ namespace Decimation.Content.Projectiles
public override void AI()
{
Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0, 0, 0, new Microsoft.Xna.Framework.Color(240, 94, 27));
Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0, 0, 0, new Color(240, 94, 27));
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
public override void OnHitNPC(Terraria.NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(ModContent.BuffType<Slimed>(), 300);
}

View File

@ -0,0 +1,48 @@
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
namespace Decimation.Content.Projectiles.Item.Accessory.Trinity
{
public class TrinityBeam : DecimationProjectile
{
public override string Texture => "Terraria/Projectile_" + ProjectileID.LightBeam;
protected override void Init()
{
Projectile refProjectile = new Projectile();
refProjectile.CloneDefaults(ProjectileID.LightBeam);
projectile.width = refProjectile.width;
projectile.height = refProjectile.height;
projectile.hostile = false;
projectile.friendly = true;
projectile.light = .7f;
projectile.penetrate = -1;
projectile.tileCollide = false;
projectile.ignoreWater = true;
projectile.aiStyle = -1;
projectile.timeLeft = 180;
}
public override void AI()
{
projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver4;
}
public override void OnHitNPC(Terraria.NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(BuffID.Weak, 300);
}
public override void OnHitPvp(Player target, int damage, bool crit)
{
target.AddBuff(BuffID.Weak, 300);
}
public override void OnHitPlayer(Player target, int damage, bool crit)
{
target.AddBuff(BuffID.Weak, 300);
}
}
}

View File

@ -4,7 +4,7 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.Item.Weapon
{
public class GreenSlime : DecimationProjectile
{

View File

@ -1,6 +1,6 @@
using Terraria.ID;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.Item.Weapon
{
internal class LightningSphere : DecimationProjectile
{

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -1,7 +1,7 @@
using Decimation.Lib.Items;
using Terraria.ID;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.Item.Weapon
{
internal class Pebble : DecimationProjectile
{

View File

@ -9,7 +9,7 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.Item.Weapon
{
internal class Scarab : DecimationProjectile
{

View File

Before

Width:  |  Height:  |  Size: 492 B

After

Width:  |  Height:  |  Size: 492 B

View File

@ -7,7 +7,7 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.Item.Weapon
{
internal class SiphonArrow : DecimationProjectile
{
@ -24,7 +24,7 @@ namespace Decimation.Content.Projectiles
aiType = ProjectileID.WoodenArrowFriendly;
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
public override void OnHitNPC(Terraria.NPC target, int damage, float knockback, bool crit)
{
Heal(damage);
}

View File

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 318 B

View File

@ -5,7 +5,7 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.Item.Weapon
{
internal class Stinger : DecimationProjectile
@ -25,7 +25,7 @@ namespace Decimation.Content.Projectiles
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
public override void OnHitNPC(Terraria.NPC target, int damage, float knockback, bool crit)
{
if (Main.rand.Next(2) == 0)
{

View File

Before

Width:  |  Height:  |  Size: 215 B

After

Width:  |  Height:  |  Size: 215 B

View File

@ -1,7 +1,7 @@
using Microsoft.Xna.Framework;
using Terraria;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.Item.Weapon
{
internal class TitanicPikeProjectile : DecimationProjectile
{

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -7,7 +7,7 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.Item.Weapon
{
internal class TitanicStyngerBolt : DecimationProjectile
{

View File

Before

Width:  |  Height:  |  Size: 303 B

After

Width:  |  Height:  |  Size: 303 B

View File

@ -4,7 +4,7 @@ using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.NPC
{
internal class Bone : DecimationProjectile
{

View File

Before

Width:  |  Height:  |  Size: 325 B

After

Width:  |  Height:  |  Size: 325 B

View File

@ -7,11 +7,11 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.NPC
{
public class MagmaBall : DecimationProjectile
{
public override string Texture => "Decimation/Content/Projectiles/MagmaBall";
public override string Texture => "Decimation/Content/Projectiles/NPC/MagmaBall";
private bool HitPlayer
{
@ -73,7 +73,7 @@ namespace Decimation.Content.Projectiles
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
var frameSize = new Vector2(projectile.width, projectile.height);
string texturePath = "Content/Projectiles/MagmaBall";
string texturePath = "Content/Projectiles/NPC/MagmaBall";
if (AlternativeTexture) texturePath += "_Alternative";
var texture = mod.GetTexture(texturePath);

View File

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 227 B

View File

Before

Width:  |  Height:  |  Size: 347 B

After

Width:  |  Height:  |  Size: 347 B

View File

@ -4,7 +4,7 @@ using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
namespace Decimation.Content.Projectiles
namespace Decimation.Content.Projectiles.NPC
{
internal class SkeletonBone : DecimationProjectile
{
@ -58,7 +58,7 @@ namespace Decimation.Content.Projectiles
set => projectile.localAI[0] = value;
}
private NPC TargetNPC => Main.npc[Target];
private Terraria.NPC TargetNPC => Main.npc[Target];
protected override void Init()
{
@ -158,7 +158,7 @@ namespace Decimation.Content.Projectiles
for (int i = 0; i < Main.npc.Length; i++)
{
NPC npc = Main.npc[i];
Terraria.NPC npc = Main.npc[i];
if (npc != null && npc.active && !npc.townNPC && npc.damage > 0 && projectile.CanHit(npc))
{
float distance = projectile.Distance(npc.Center);

View File

Before

Width:  |  Height:  |  Size: 292 B

After

Width:  |  Height:  |  Size: 292 B

View File

@ -1,6 +1,7 @@
using Decimation.Content.Buffs.Debuffs;
using Decimation.Content.Items.Amulets;
using Decimation.Content.Projectiles;
using Decimation.Content.Projectiles.Boss.Arachnus;
using Decimation.Lib.Amulets.Synergy;
using Decimation.Lib.Util;
using Microsoft.Xna.Framework;