public override void WeaponStopped(Weapon weaponThatStopped) { OwnerCharacterHandleWeapon = Weapons[_currentWeaponIndex].CharacterHandleWeapon; DroppableCombo = true; // Todo: remove when inspector no longer offers this as an option if (OwnerCharacterHandleWeapon == null) { return; } ProcessComboByState(StartComboState.WeaponStop); //Reset the weapon back to the first one. This is so the player can execute out of combo and start over from the first weapon in the combo OwnerCharacterHandleWeapon.CurrentWeapon = Weapons[0]; OwnerCharacterHandleWeapon.ChangeWeapon(Weapons[0], Weapons[0].WeaponID, true); }
private void CheckIfWeaponShouldBeSwitched() { if (Weapons.Length <= 1 || !_countdownActive) { return; } if (TimeSinceLastWeaponStopped < ExecutionWindowTime && TimeSinceLastWeaponStopped + Time.deltaTime > ExecutionWindowTime) { _currentWeaponIndex += 1; //Weapons are swapped like this because Corgi handles weapon in a way that doesn't easily support this without deeper edits OwnerCharacterHandleWeapon.CurrentWeapon = Weapons[_currentWeaponIndex]; OwnerCharacterHandleWeapon.ChangeWeapon(Weapons[_currentWeaponIndex], Weapons[_currentWeaponIndex].WeaponID, true); } }
protected override void ResetCombo() { if (Weapons.Length > 1) { if (_countdownActive && DroppableCombo) { TimeSinceLastWeaponStopped += Time.deltaTime; if (TimeSinceLastWeaponStopped > DropComboDelay) { _countdownActive = false; _currentWeaponIndex = 0; OwnerCharacterHandleWeapon.CurrentWeapon = Weapons[_currentWeaponIndex]; OwnerCharacterHandleWeapon.ChangeWeapon(Weapons[_currentWeaponIndex], Weapons[_currentWeaponIndex].WeaponID, true); RhythmicComboEvent.Trigger(DropComboDelay, ExecutionWindowTime, ComboStatuses.TimedOut); StopIndicator(); } } } }