public static string ToFriendlyString(this PrimaryActions action) { switch (action) { case PrimaryActions.shoot: return($"{nameof(PrimaryActions.shoot)}_"); case PrimaryActions.walk: return($"{nameof(PrimaryActions.walk)}_"); case PrimaryActions.Fireball: return($"{nameof(PrimaryActions.Fireball)}_"); case PrimaryActions.Skull: return($"{nameof(PrimaryActions.Skull)}_"); case PrimaryActions.Death: return($"{nameof(PrimaryActions.Death)}_"); case PrimaryActions.ProjectileExplosion: return($"{nameof(PrimaryActions.ProjectileExplosion)}_"); case PrimaryActions.reloading: return($"{nameof(PrimaryActions.reloading)}_"); } return($"{nameof(PrimaryActions.idle)}_"); }
private string GetChainName(PrimaryActions primaryAction, SecondaryActions secondaryActions) { if (aimingVector.X != 0 || aimingVector.Y != 0) { var direction = TopDownDirectionExtensions.FromDirection(new Vector2(aimingVector.X, aimingVector.Y), PossibleDirections.EightWay); return(ChainNameHelperMethods.GenerateChainName(primaryAction, null, direction)); } else { return(ChainNameHelperMethods.GenerateChainName(primaryAction, null, TopDownDirection.Right)); } }
private void UpdateCurrentMovementValues() { bool isBossReloading = false; if (CurrentBehavior == Behavior.Shooting) { mCurrentMovement = TopDownValues[DataTypes.TopDownValues.WhileShooting]; } else if (CurrentBehavior == Behavior.Reloading) { if (CurrentDataCategoryState == DataCategory.Boss) { mCurrentMovement = TopDownValues[DataTypes.TopDownValues.BossReloading]; currentPrimaryAction = PrimaryActions.reloading; isBossReloading = true; } else { mCurrentMovement = TopDownValues[DataTypes.TopDownValues.WhileReloading]; } PlayReloadingSound(); } else { if (this.CurrentDataCategoryState == DataCategory.SuiciderFast) { mCurrentMovement = TopDownValues[DataTypes.TopDownValues.SuiciderFast]; } else { mCurrentMovement = TopDownValues[DataTypes.TopDownValues.DefaultValues]; } } if (IsOnMud && !isBossReloading) { if (this.CurrentDataCategoryState == DataCategory.SuiciderFast) { mCurrentMovement = TopDownValues[DataTypes.TopDownValues.SuiciderFastMud]; } else { mCurrentMovement = TopDownValues[DataTypes.TopDownValues.EnemyMud]; } } }
private string GetChainName(PrimaryActions primaryAction, SecondaryActions secondaryAction = SecondaryActions.None) { Weapon?weapon = null; if (secondaryAction == SecondaryActions.Shooting) { weapon = EquippedWeapon; } if (aimingVector.X != 0 || aimingVector.Y != 0) { var direction = TopDownDirectionExtensions.FromDirection(new Vector2(aimingVector.X, aimingVector.Y), PossibleDirections.EightWay); return(ChainNameHelperMethods.GenerateChainName(primaryAction, weapon, direction)); } else { return(ChainNameHelperMethods.GenerateChainName(primaryAction, weapon, TopDownDirection.Right)); } }
public static string GenerateChainName(PrimaryActions primaryAction, TopDownDirection direction) { return($"{primaryAction.ToFriendlyString()}{direction.ToFriendlyString()}"); }
private void UpdatePrimaryAction() { const float movementThreashHold = 0.01f; currentPrimaryAction = Velocity.LengthSquared() > movementThreashHold ? PrimaryActions.walk : PrimaryActions.idle; }
private void DoPrimaryActionActivity() { const float movementThreashHold = 0.01f; currentPrimaryAction = MovementInput.Magnitude > movementThreashHold ? PrimaryActions.walk : PrimaryActions.idle; }