Exemplo n.º 1
0
        public override void Update(AIEnemyHuman ai)
        {
            var attackZone = ai.GetAttackZone(new Vector2(20, 0), new Vector2(40, 30));

            if (!(ai.Target.Weapon is WeaponUnarmed) && !ai.IsAttacking() && IsInMeleeRange(ai, attackZone) && ai.AttackCooldown <= 0 && ai.Target.Invincibility < 3)
            {
                ai.Owner.Velocity.X += Math.Sign(ai.DifferenceVector.X) * 2;
                ai.CurrentAction     = new ActionStealWeapon(ai.Owner, ai.Target, 4, 8);
                ai.AttackCooldown    = 15;
            }
        }
Exemplo n.º 2
0
        public override void Update(AIEnemyHuman ai)
        {
            var attackZone = ai.GetAttackZone(new Vector2(20, 0), new Vector2(40, 30));

            if (!ai.IsAttacking() && ai.OnGround && IsInMeleeRange(ai, attackZone) && ai.AttackCooldown <= 0 && ai.Target.Invincibility < 3)
            {
                ai.Owner.Velocity.X += Math.Sign(ai.DifferenceVector.X) * 2;
                ai.CurrentAction     = new ActionTwohandSlash(ai.Owner, 3, 12, ai.Weapon);
                ai.AttackCooldown    = 30;
            }
        }
Exemplo n.º 3
0
        public override void Update(AIEnemyHuman ai)
        {
            var katana     = ai.Weapon as WeaponKatana;
            var attackZone = ai.GetAttackZone(new Vector2(20, 0), new Vector2(40, 30));

            if (katana.Sheathed && !ai.IsAttacking() && IsInMeleeRange(ai, attackZone) && ai.AttackCooldown <= 0 && ai.Target.Invincibility < 3)
            {
                ai.Owner.Velocity.X += Math.Sign(ai.DifferenceVector.X) * 2;
                ai.CurrentAction     = new ActionKatanaSlash(ai.Owner, 2, 4, 12, 4, katana);
                ai.AttackCooldown    = 30;
            }
        }
        public override void Update(AIEnemyHuman ai)
        {
            var gauntlet   = ai.Weapon as WeaponAlchemicalGauntlet;
            var attackZone = ai.GetAttackZone(new Vector2(20, 0), new Vector2(20, 30));

            if (gauntlet.Orb is OrangeOrb && !ai.IsAttacking() && IsInMeleeRange(ai, attackZone) && ai.AttackCooldown <= 0 && ai.Target.Invincibility < 3)
            {
                Bomb bomb = (Bomb)ai.Target.StatusEffects.Find(status => status is Bomb);
                if ((bomb != null && bomb.Stacks < bomb.StacksMax) || bomb == null)
                {
                    ai.CurrentAction  = new ActionTransplantPunch(ai.Owner, 4, 6, ai.Weapon);
                    ai.AttackCooldown = 20;
                }
            }
        }
Exemplo n.º 5
0
        public override void Update(AIEnemyHuman ai)
        {
            var attackZone = ai.GetAttackZone(new Vector2(20, 0), new Vector2(40, 30));

            if (!ai.IsAttacking() && IsInMeleeRange(ai, attackZone) && ai.AttackCooldown <= 0 && ai.Target.Invincibility < 3)
            {
                ai.Owner.Velocity.X += Math.Sign(ai.DifferenceVector.X) * 2;

                ActionBase[] actionHolder =
                {
                    new ActionSlash(ai.Owner,   2, 4, 8, 2, ai.Weapon),
                    new ActionSlashUp(ai.Owner, 2, 4, 8, 2, ai.Weapon)
                };
                ai.CurrentAction  = actionHolder[ai.Random.Next(0, actionHolder.Length - 1)];
                ai.AttackCooldown = 30;
            }
        }
Exemplo n.º 6
0
        public override void Update(AIEnemyHuman ai)
        {
            var attackZone = ai.GetAttackZone(new Vector2(20, 0), new Vector2(40, 30));

            if (!ai.IsAttacking() && IsInMeleeRange(ai, attackZone) && ai.AttackCooldown <= 0 && ai.Target.Invincibility < 3)
            {
                if (ai.OnGround)
                {
                    ai.Owner.Velocity.X += GetFacingVector(ai.Owner.Facing).X * 0.75f;
                    ai.Owner.Velocity.Y  = -ai.Owner.GetJumpVelocity(8);
                    ai.OnGround          = false;
                }
                else
                {
                    ai.Owner.Velocity.X += GetFacingVector(ai.Owner.Facing).X * 0.5f;
                }
                ai.CurrentAction  = new ActionRapierThrust(ai.Owner, 4, 8, ai.Weapon);
                ai.AttackCooldown = 30;
            }
        }