Exemple #1
0
        public override ProjectileInfo Clone()
        {
            AffixProjectileInfo clone = new AffixProjectileInfo();

            clone.weapon = weapon;
            return(clone);
        }
        public override void OnHitNPC(Projectile projectile, NPC target, int damage, float knockback, bool crit)
        {
            AffixProjectileInfo info = projectile.GetAffixInfo(mod);

            if (info.weapon != null)
            {
                info.weapon.GetAffixInfo(mod)?.OnHitNPC(info.weapon, projectile.GetOwner(), projectile, target, damage, knockback, crit);
            }
        }
Exemple #3
0
        public override void OnHitByProjectile(NPC npc, Projectile projectile, int damage, float knockback, bool crit)
        {
            AffixProjectileInfo projectileInfo = projectile.GetAffixInfo(mod);

            if (projectileInfo.weapon != null)
            {
                npc.GetAffixInfo(mod).AddParticipant(projectile.GetOwner(), projectileInfo.weapon);
            }
        }
        public override void PostAI(Projectile projectile)
        {
            Player player = projectile.GetOwner();

            if (player == null)
            {
                return;
            }

            AffixProjectileInfo info = projectile.GetAffixInfo(mod);

            if (info.weapon == null)
            {
                info.weapon = player.HeldItem;
            }
        }