Пример #1
0
        public override Vector2 IdleBehavior()
        {
            int             angleFrame  = animationFrame % AnimationFrames;
            float           angle       = 2 * (float)(Math.PI * angleFrame) / AnimationFrames;
            float           radius      = 36;
            Vector2         angleVector = radius * new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle));
            SquireModPlayer modPlayer   = player.GetModPlayer <SquireModPlayer>();

            if (modPlayer.HasSquire())
            {
                projectile.spriteDirection = modPlayer.GetSquire().spriteDirection;
            }
            // offset downward vertically a bit
            // the scale messes with the positioning in some way
            return(base.IdleBehavior() + angleVector + new Vector2(0, 8));
        }
Пример #2
0
        public override void ModifyHitNPC(Projectile projectile, NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection)
        {
            if (!DoesSummonDamage(projectile))
            {
                return;
            }
            Player player = Main.player[projectile.owner];
            MinionSpawningItemPlayer modPlayer    = player.GetModPlayer <MinionSpawningItemPlayer>();
            SquireModPlayer          squirePlayer = player.GetModPlayer <SquireModPlayer>();
            // require multiple minion types for any bonus
            float damageMult = 1;

            if (modPlayer.minionVarietyBonusCount > 1)
            {
                damageMult += modPlayer.minionVarietyBonusCount * modPlayer.minionVarietyDamageBonus;
            }
            if (squirePlayer.GetSquire() != default)
            {
                damageMult -= ServerConfig.Instance.MinionDamageSquireNerf / 100f;
            }
            damage = (int)(damage * damageMult);
        }
Пример #3
0
 protected override bool IsEquipped(SquireModPlayer player) => player.HasSquire() &&
 player.GetSquire().type == ProjectileType <TitaniumSquireMinion>();