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)); } } } }
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)); } } }
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); }
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)); } } } }
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); }
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)); } }