public override void DoUpdate(GameTime gameTime)
 {
     MagicParams.SetMagicUser(Parent);
     Params.SharedParams.OwnerPosition = Collision.ListCollisionPolygon[0].Center;
     Params.SharedParams.OwnerAngle = (float)Math.Atan2(Speed.Y, Speed.X);
     Collision.ListCollisionPolygon[0].Offset(Speed.X, Speed.Y);
 }
Beispiel #2
0
        public void SetParam(MagicParams param, int value)
        {
            ThrowIfDisposed();

            if (MagicNative.magic_setparam(_magic, param, ref value) < 0)
            {
                throw new MagicException($"Invalid param \"{param}\".");
            }
        }
Beispiel #3
0
        public int GetParam(MagicParams param)
        {
            ThrowIfDisposed();

            if (MagicNative.magic_getparam(_magic, param, out int value) < 0)
            {
                throw new MagicException($"Invalid param \"{param}\".");
            }

            return(value);
        }
        protected override string DoExecuteEffect()
        {
            Owner.NumberOfExecutions++;
            Params.SharedParams.OwnerAngle += MathHelper.ToRadians((float)ExtraAngleInDegrees);

            Fireball NewFireball = new Fireball(MagicParams, Params, this);

            //Clone the following skills so they are not share by every bullets.
            NewFireball.ListActiveSkill = new List<BaseAutomaticSkill>(ListFollowingSkill.Count);
            foreach (BaseAutomaticSkill ActiveFollowingSkill in ListFollowingSkill)
            {
                MagicParams.SetMagicUser(this);
                BaseAutomaticSkill NewSkill = new BaseAutomaticSkill(ActiveFollowingSkill);
                NewFireball.ListActiveSkill.Add(NewSkill);
            }

            Params.LocalContext.OwnerSandbox.AddProjectile(NewFireball);

            return null;
        }
Beispiel #5
0
        protected override string DoExecuteEffect()
        {
            Owner.NumberOfExecutions++;
            InvisibleFireball NewFireball = new InvisibleFireball(5, new ExplosionOptions(), AttackParams.LocalContext.Owner, AttackParams.SharedParams.OwnerPosition, 0,
                                                                  MagicParams, this);

            //Clone the following skills so they are not share by every bullets.
            NewFireball.ListActiveSkill = new List <BaseAutomaticSkill>(ListFollowingSkill.Count);
            foreach (BaseAutomaticSkill ActiveFollowingSkill in ListFollowingSkill)
            {
                AttackParams.LocalContext.Owner.SetAttackContext(NewFireball, AttackParams.LocalContext.Owner, AttackParams.SharedParams.OwnerAngle, AttackParams.SharedParams.OwnerPosition);
                MagicParams.SetMagicUser(this);
                BaseAutomaticSkill NewSkill = new BaseAutomaticSkill(ActiveFollowingSkill);
                NewFireball.ListActiveSkill.Add(NewSkill);
            }

            ListFollowingSkill = NewFireball.ListActiveSkill;
            AttackParams.LocalContext.OwnerSandbox.AddProjectile(NewFireball);

            return(null);
        }
 public override void SetupParamsBeforeCopy()
 {
     MagicParams.SetMagicTarget(this);
 }
Beispiel #7
0
 public static extern int magic_setparam(IntPtr magic_cookie, MagicParams param, ref int value);
Beispiel #8
0
 public static extern int magic_getparam(IntPtr magic_cookie, MagicParams param, out int value);