Removed Triploon
This commit is contained in:
1 parent
d788e3fb33
commit
d7d83e7675
4 files changed
-179
No files matched your search
@@ -1,80 +0,0 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public class Triploon : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Triploon");
|
||||
Tooltip.SetDefault("Launches three harpoons");
|
||||
SacrificeTotal = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.damage = 70;
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.width = 46;
|
||||
Item.height = 24;
|
||||
Item.useTime = 20;
|
||||
Item.useAnimation = 20;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 7.5f;
|
||||
Item.value = Item.buyPrice(0, 60, 0, 0);
|
||||
Item.rare = ItemRarityID.Lime;
|
||||
Item.UseSound = SoundID.Item10;
|
||||
Item.autoReuse = true;
|
||||
Item.shootSpeed = 20f;
|
||||
Item.shoot = ModContent.ProjectileType<TriploonProj>();
|
||||
Item.Calamity().canFirePointBlankShots = true;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-10, 0);
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 center = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
float piOverTen = MathHelper.Pi * 0.1f;
|
||||
int projCount = 3;
|
||||
|
||||
velocity.Normalize();
|
||||
velocity *= 30f;
|
||||
bool canHit = Collision.CanHit(center, 0, 0, center + velocity, 0, 0);
|
||||
for (int projIndex = 0; projIndex < projCount; projIndex++)
|
||||
{
|
||||
float num120 = projIndex - (projCount - 1f) / 2f;
|
||||
Vector2 offset = velocity.RotatedBy(piOverTen * num120);
|
||||
if (!canHit)
|
||||
{
|
||||
offset -= velocity;
|
||||
}
|
||||
Projectile.NewProjectile(spawnSource, center.X + offset.X, center.Y + offset.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<Dualpoon>().
|
||||
AddIngredient(ItemID.Harpoon).
|
||||
AddIngredient<DepthCells>(15).
|
||||
AddIngredient<Lumenyl>(5).
|
||||
AddIngredient<Tenebris>(5).
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.7 KiB |
@@ -1,99 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
public class TriploonProj : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Triploon");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 4;
|
||||
Projectile.height = 4;
|
||||
Projectile.friendly = true;
|
||||
Projectile.penetrate = 1;
|
||||
Projectile.alpha = 255;
|
||||
Projectile.DamageType = DamageClass.Ranged;
|
||||
Projectile.extraUpdates = 0;
|
||||
Projectile.timeLeft = 300;
|
||||
Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Player player = Main.player[Projectile.owner];
|
||||
if (player.dead)
|
||||
{
|
||||
Projectile.Kill();
|
||||
return;
|
||||
}
|
||||
if (Projectile.alpha == 0)
|
||||
{
|
||||
if (Projectile.Center.X > player.Center.X)
|
||||
{
|
||||
player.ChangeDir(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.ChangeDir(-1);
|
||||
}
|
||||
}
|
||||
if (Projectile.ai[0] == 0f)
|
||||
{
|
||||
Projectile.extraUpdates = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
Projectile.extraUpdates = 1;
|
||||
}
|
||||
Vector2 playerVector = player.Center - Projectile.Center;
|
||||
float playerDist = playerVector.Length();
|
||||
if (Projectile.ai[0] == 0f)
|
||||
{
|
||||
if (playerDist > 700f)
|
||||
{
|
||||
Projectile.ai[0] = 1f;
|
||||
}
|
||||
else if (playerDist > 350f)
|
||||
{
|
||||
Projectile.ai[0] = 1f;
|
||||
}
|
||||
Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X) + MathHelper.PiOver2;
|
||||
Projectile.ai[1] += 1f;
|
||||
if (Projectile.ai[1] > 5f)
|
||||
{
|
||||
Projectile.alpha = 0;
|
||||
}
|
||||
if (Projectile.ai[1] > 8f)
|
||||
{
|
||||
Projectile.ai[1] = 8f;
|
||||
}
|
||||
if (Projectile.ai[1] >= 10f)
|
||||
{
|
||||
Projectile.ai[1] = 15f;
|
||||
Projectile.velocity.Y += 0.3f;
|
||||
}
|
||||
}
|
||||
else if (Projectile.ai[0] == 1f)
|
||||
{
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.rotation = (float)Math.Atan2((double)playerVector.Y, (double)playerVector.X) - MathHelper.PiOver2;
|
||||
float returnSpeed = 20f;
|
||||
if (playerDist < 50f)
|
||||
{
|
||||
Projectile.Kill();
|
||||
}
|
||||
playerDist = returnSpeed / playerDist;
|
||||
playerVector.X *= playerDist;
|
||||
playerVector.Y *= playerDist;
|
||||
Projectile.velocity.X = playerVector.X;
|
||||
Projectile.velocity.Y = playerVector.Y;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 479 B |
Reference in new issue
Block a user