DoYouEvenCookie
Terrarian
There must be something wrong there somewhere. I'll have to see all of your projectile's code to really see what's happening. If someone else spots the problem before I do, feel free to jump in with a solution.
Code:
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Microsoft.Xna.Framework;
namespace Pack.Projectiles
{
public class PossessedTempliteHammerP : ModProjectile
{
public override void SetDefaults()
{
projectile.name = "Possessed Templite Hammer";
projectile.width = 52;
projectile.height = 52;
projectile.friendly = true;
projectile.penetrate = -1;
projectile.aiStyle = 3;
projectile.melee = true;
projectile.tileCollide = false;
projectile.timeLeft = 60000;
projectile.light = 1f;
}
public override void OnHitNPC(NPC n, int damage, float knockback, bool crit)
{
Player player = Main.player[projectile.owner];
player.statLife += 10; //Heals by 10; Can be changed of course
player.HealEffect(10); //Shows a green 10 above your head to show you've been healed; Can be changed of course
if (projectile.ai[1] > 0)
projectile.ai[0] = 0;
if (projectile.ai[0] == 0f)
{
projectile.velocity *= -1;
}
projectile.netUpdate = true;
}
public override void PostAI()
{
Main.NewText("ai[0]: " + projectile.ai[0] + ", ai[1]: " + projectile.ai[1]);
if (projectile.ai[0] == 1)
{
projectile.velocity *= 2;
}
}
}
}