示例#1
0
        public void UnholsterWeaponsIfNeeded()
        {
            if (PrimaryWeapons.HasHolsteredWeapons)
            {
                if (PrimaryWeapons.ActiveWeapons.Contains(SecondaryWeapons.ActiveWeapons[0]))
                {
                    foreach (WeaponBase ActiveWeapon in PrimaryWeapons.ActiveWeapons)
                    {
                        RemovePartialAnimation(ActiveWeapon.GetAnimationName(ActiveMovementStance));
                    }
                    PrimaryWeapons.RemoveAllActiveWeapons();
                }

                List <WeaponBase> ListUnHolsteredWeapon = PrimaryWeapons.UseHolsteredWeapons();

                foreach (WeaponBase WeaponToUse in ListUnHolsteredWeapon)
                {
                    WeaponToUse.CurrentAnimation = null;
                    WeaponToUse.ResetAnimation(ActiveMovementStance);
                    WeaponToUse.InitiateFollowingAttack(true, ActiveMovementStance, this);

                    if (WeaponToUse.CurrentAnimation == null)
                    {
                        ActivatePartialWeapon(WeaponToUse, WeaponToUse.GetAnimationName(ActiveMovementStance));
                    }
                }
            }
        }
示例#2
0
        public void ChangeWeapon(int WeaponIndex)
        {
            if (WeaponIndex == -1)//Unequip weapon
            {
                foreach (WeaponBase ActiveWeapon in PrimaryWeapons.ActiveWeapons)
                {
                    RemovePartialAnimation(ActiveWeapon.GetAnimationName(ActiveMovementStance));
                }

                PrimaryWeapons.RemoveAllActiveWeapons();
                PrimaryWeapons.UseWeapon(CurrentStanceAnimations);
            }
            else
            {
                string WeaponName = PrimaryWeapons.GetWeaponName(WeaponIndex);
                PrimaryWeapons.RemoveAllActiveWeapons();
                PrimaryWeapons.UseWeapon(WeaponName);
                WeaponBase WeaponToUse = PrimaryWeapons.GetWeapon(WeaponName);

                WeaponToUse.CurrentAnimation = null;
                WeaponToUse.ResetAnimation(ActiveMovementStance);
                WeaponToUse.InitiateFollowingAttack(true, ActiveMovementStance, this);

                if (WeaponToUse.CurrentAnimation == null)
                {
                    ActivatePartialWeapon(WeaponToUse, WeaponToUse.GetAnimationName(ActiveMovementStance));
                }
            }
        }
示例#3
0
        public void DropActiveWeapons()
        {
            foreach (WeaponDrop DroppedWeapon in PrimaryWeapons.DropActiveWeapon(Position, CurrentLayer))
            {
                CurrentLayer.AddDroppedWeapon(DroppedWeapon);
            }

            foreach (WeaponBase ActiveWeapon in PrimaryWeapons.ActiveWeapons)
            {
                RemovePartialAnimation(ActiveWeapon.GetAnimationName(ActiveMovementStance));
            }

            PrimaryWeapons.UseWeapon(CurrentStanceAnimations);
        }
示例#4
0
 public void SetRobotAnimation(string ActiveMovementStance)
 {
     foreach (WeaponBase ActiveWeapon in PrimaryWeapons.ActiveWeapons)
     {
         if (ActiveWeapon.GetAnimationType(ActiveMovementStance) == AnimationTypes.FullAnimation)
         {
             ActiveWeapon.CurrentAnimation = SetAnimation(ActiveWeapon.GetAnimationName(ActiveMovementStance));
         }
         else
         {
             SetAnimation(CurrentStanceAnimations.GetAnimationName(ActiveMovementStance));
             if (ActiveWeapon.CurrentAnimation == null)
             {
                 ActivatePartialWeapon(ActiveWeapon, ActiveWeapon.GetAnimationName(ActiveMovementStance));
             }
         }
     }
 }
示例#5
0
        public void ReplacePrimaryWeapon(string WeaponToPickUpName)
        {
            if (PrimaryWeapons.HasActiveWeapon(WeaponToPickUpName))
            {
                return;
            }

            if (PrimaryWeapons.HasActiveWeapons)
            {
                foreach (WeaponBase ActiveWeapon in PrimaryWeapons.ActiveWeapons)
                {
                    RemovePartialAnimation(ActiveWeapon.GetAnimationName(ActiveMovementStance));
                }

                PrimaryWeapons.DropActiveWeapon();
            }

            EquipWeapon(WeaponToPickUpName);
        }
示例#6
0
        public void HolsterAndReplaceWeapon(WeaponBase WeaponToUse)
        {
            foreach (WeaponBase ActiveWeapon in PrimaryWeapons.ActiveWeapons)
            {
                RemovePartialAnimation(ActiveWeapon.GetAnimationName(ActiveMovementStance));
            }

            PrimaryWeapons.HolsterAllActiveWeapons();
            PrimaryWeapons.UseWeapon(WeaponToUse);

            WeaponToUse.CurrentAnimation = null;
            WeaponToUse.ResetAnimation(ActiveMovementStance);
            WeaponToUse.InitiateFollowingAttack(true, ActiveMovementStance, this);

            if (WeaponToUse.CurrentAnimation == null)
            {
                ActivatePartialWeapon(WeaponToUse, WeaponToUse.GetAnimationName(ActiveMovementStance));
            }
        }