Removed Dualpoon
This commit is contained in:
1 parent
15b4da5bf6
commit
d788e3fb33
4 files changed
-176
No files matched your search
@@ -1,77 +0,0 @@
|
||||
using Terraria.DataStructures;
|
||||
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 Dualpoon : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Dualpoon");
|
||||
Tooltip.SetDefault("Launches two harpoons");
|
||||
SacrificeTotal = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.damage = 70;
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.width = 56;
|
||||
Item.height = 28;
|
||||
Item.useTime = 20;
|
||||
Item.useAnimation = 20;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 6.5f;
|
||||
Item.value = Item.buyPrice(0, 36, 0, 0);
|
||||
Item.rare = ItemRarityID.Pink;
|
||||
Item.UseSound = SoundID.Item10;
|
||||
Item.autoReuse = true;
|
||||
Item.shootSpeed = 20f;
|
||||
Item.shoot = ModContent.ProjectileType<DualpoonProj>();
|
||||
Item.Calamity().canFirePointBlankShots = true;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-5, 0);
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
float piOverTen = MathHelper.Pi * 0.1f;
|
||||
int projCount = 2;
|
||||
|
||||
velocity.Normalize();
|
||||
velocity *= 40f;
|
||||
bool canHit = Collision.CanHit(source, 0, 0, source + velocity, 0, 0);
|
||||
for (int projIndex = 0; projIndex < projCount; projIndex++)
|
||||
{
|
||||
float num120 = projIndex - (projCount - 1f) / 2f;
|
||||
Vector2 offset = velocity.RotatedBy((double)(piOverTen * num120), default);
|
||||
if (!canHit)
|
||||
{
|
||||
offset -= velocity;
|
||||
}
|
||||
Projectile.NewProjectile(spawnSource, source.X + offset.X, source.Y + offset.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient(ItemID.Harpoon, 2).
|
||||
AddIngredient<SeaPrism>(15).
|
||||
AddIngredient(ItemID.SoulofMight, 10).
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 882 B |
@@ -1,99 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
public class DualpoonProj : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Dualpoon");
|
||||
}
|
||||
|
||||
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: 294 B |
Reference in new issue
Block a user