コード例 #1
0
        /// <summary>
        /// Activates the tome skill.
        /// </summary>
        /// <param name="p">The <see cref="Player" /> that activated the skill.</param>
        /// <remarks>No NetMessages have to be sent, this method is called on all clients and the server.</remarks>
        public override void Activate(Player p)
        {
            if (p.statMana < 3f * p.manaCost)
                return;
            p.statMana = (int)(p.statMana - 3f * p.manaCost);

            double rot = p.AngleTo(Main.mouseWorld);

            ExtendedSpawning.NewProj(p.Centre, new Vector2((float)Math.Cos(rot) * 10f, (float)Math.Sin(rot) * 10f), 85, (int)(32f * p.magicDamage), 1.1f, p.whoAmI);
        }