Exemple #1
0
        public override void Update(Player player, SkillData rawdata)
        {
            DivineSmiteData data = (DivineSmiteData)rawdata;

            if (data.StarCooldown > 0)
            {
                data.StarCooldown--;
            }
        }
Exemple #2
0
        private void TryDroppingStar(Player caster, SkillData rawdata, NPC target)
        {
            if (target.life <= 0)
            {
                return;
            }
            DivineSmiteData data = (DivineSmiteData)rawdata;

            if (data.StarCooldown <= 0)
            {
                List <sbyte> StarPositions = new List <sbyte>();
                for (sbyte s = -2; s <= 2; s++)
                {
                    StarPositions.Add(s);
                }
                byte MaxStars = (byte)(1 + rawdata.Level / 5);
                if (MaxStars > 5)
                {
                    MaxStars = 5;
                }
                for (int i = 0; i < MaxStars; i++)
                {
                    sbyte StarInclination = 0;
                    {
                        int PickedOne = Main.rand.Next(StarPositions.Count);
                        StarInclination = StarPositions[PickedOne];
                        StarPositions.RemoveAt(PickedOne);
                    }
                    Vector2 StarSpawnPosition = new Vector2(target.position.X + 100f * StarInclination, target.position.Y - 600) + target.velocity;
                    Vector2 ShotDirection     = (target.Center - StarSpawnPosition);
                    ShotDirection.Normalize();
                    ShotDirection *= 28;
                    int Damage = rawdata.GetMagicDamage(0, 0.26f + 0.04f * data.Level, caster);
                    Projectile.NewProjectile(StarSpawnPosition, ShotDirection, 92, Damage, 0, caster.whoAmI);
                }
                data.StarCooldown = (int)(3 * 60);
            }
        }