2021-08-23 00:37:37 +02:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class PlayerComboSystem : MonoBehaviour
|
|
|
|
|
{
|
2024-01-08 23:13:48 +02:00
|
|
|
public static AttackSO GetComboAttack(PlayerStatsSO playerStats, InputEnum inputEnum, Vector2 direction, bool isAir)
|
2022-11-28 02:57:32 +02:00
|
|
|
{
|
2022-12-27 17:24:54 +02:00
|
|
|
if (inputEnum == InputEnum.Special)
|
2024-01-08 23:13:48 +02:00
|
|
|
return GetArcana(playerStats, direction, isAir);
|
2022-11-28 02:57:32 +02:00
|
|
|
if (inputEnum == InputEnum.Throw)
|
2022-12-21 19:25:32 +02:00
|
|
|
return playerStats.mThrow;
|
2024-01-12 04:23:09 +02:00
|
|
|
if (direction.y == -1 && !isAir)
|
2022-12-21 19:25:32 +02:00
|
|
|
return GetCrouchingAttackType(playerStats, inputEnum);
|
2022-11-28 02:57:32 +02:00
|
|
|
else
|
|
|
|
|
if (isAir)
|
2023-04-18 00:44:43 +03:00
|
|
|
return GetJumpAttackType(playerStats, inputEnum);
|
|
|
|
|
else
|
|
|
|
|
return GetStandingAttackType(playerStats, inputEnum);
|
2022-11-28 02:57:32 +02:00
|
|
|
}
|
2021-09-28 17:04:18 +02:00
|
|
|
|
2022-12-21 19:25:32 +02:00
|
|
|
private static AttackSO GetJumpAttackType(PlayerStatsSO playerStats, InputEnum inputEnum)
|
2022-11-28 02:57:32 +02:00
|
|
|
{
|
|
|
|
|
if (inputEnum == InputEnum.Light)
|
2022-12-21 19:25:32 +02:00
|
|
|
return playerStats.jL;
|
2022-11-28 02:57:32 +02:00
|
|
|
else if (inputEnum == InputEnum.Medium)
|
2022-12-21 19:25:32 +02:00
|
|
|
return playerStats.jM;
|
2022-11-28 02:57:32 +02:00
|
|
|
else
|
2022-12-21 19:25:32 +02:00
|
|
|
return playerStats.jH;
|
2022-11-28 02:57:32 +02:00
|
|
|
}
|
2022-07-24 01:25:32 +03:00
|
|
|
|
2022-12-21 19:25:32 +02:00
|
|
|
private static AttackSO GetCrouchingAttackType(PlayerStatsSO playerStats, InputEnum inputEnum)
|
2022-11-28 02:57:32 +02:00
|
|
|
{
|
|
|
|
|
if (inputEnum == InputEnum.Light)
|
2022-12-21 19:25:32 +02:00
|
|
|
return playerStats.m2L;
|
2022-11-28 02:57:32 +02:00
|
|
|
else if (inputEnum == InputEnum.Medium)
|
2022-12-21 19:25:32 +02:00
|
|
|
return playerStats.m2M;
|
2023-02-27 16:15:20 +02:00
|
|
|
else if (inputEnum == InputEnum.Heavy)
|
2022-12-21 19:25:32 +02:00
|
|
|
return playerStats.m2H;
|
2023-02-27 16:15:20 +02:00
|
|
|
return null;
|
2022-11-28 02:57:32 +02:00
|
|
|
}
|
2022-02-23 00:25:32 +01:00
|
|
|
|
2022-12-21 19:25:32 +02:00
|
|
|
private static AttackSO GetStandingAttackType(PlayerStatsSO playerStats, InputEnum inputEnum)
|
2022-11-28 02:57:32 +02:00
|
|
|
{
|
|
|
|
|
if (inputEnum == InputEnum.Light)
|
2022-12-21 19:25:32 +02:00
|
|
|
return playerStats.m5L;
|
2022-11-28 02:57:32 +02:00
|
|
|
else if (inputEnum == InputEnum.Medium)
|
2022-12-21 19:25:32 +02:00
|
|
|
return playerStats.m5M;
|
2023-02-27 16:15:20 +02:00
|
|
|
else if (inputEnum == InputEnum.Heavy)
|
2022-12-21 19:25:32 +02:00
|
|
|
return playerStats.m5H;
|
2023-02-27 16:15:20 +02:00
|
|
|
return null;
|
2022-11-28 02:57:32 +02:00
|
|
|
}
|
2022-02-23 00:25:32 +01:00
|
|
|
|
2023-04-18 00:44:43 +03:00
|
|
|
public static AttackSO GetThrow(PlayerStatsSO playerStats) => playerStats.mThrow;
|
|
|
|
|
|
|
|
|
|
public static AttackSO GetRedFrenzy(PlayerStatsSO playerStats) => playerStats.mRedFrenzy;
|
2022-04-21 23:58:15 +02:00
|
|
|
|
2024-01-08 23:13:48 +02:00
|
|
|
public static ArcanaSO GetArcana(PlayerStatsSO playerStats, Vector2 direction = default, bool isAir = false, bool frenzied = false)
|
2022-12-23 03:17:40 +02:00
|
|
|
{
|
|
|
|
|
if (isAir)
|
2023-11-14 15:31:56 +02:00
|
|
|
if (frenzied)
|
|
|
|
|
return playerStats.jArcanaFrenzy;
|
|
|
|
|
else
|
|
|
|
|
return playerStats.jArcana;
|
2024-01-10 19:37:47 +02:00
|
|
|
if (direction.y == -1)
|
2024-01-08 23:13:48 +02:00
|
|
|
{
|
2023-11-14 15:31:56 +02:00
|
|
|
if (frenzied)
|
|
|
|
|
return playerStats.m2ArcanaFrenzy;
|
|
|
|
|
else
|
|
|
|
|
return playerStats.m2Arcana;
|
2024-01-08 23:13:48 +02:00
|
|
|
}
|
|
|
|
|
if (direction == Vector2.zero)
|
|
|
|
|
{
|
|
|
|
|
if (frenzied)
|
|
|
|
|
return playerStats.m5ArcanaFrenzy;
|
|
|
|
|
else
|
|
|
|
|
return playerStats.m5Arcana;
|
|
|
|
|
}
|
|
|
|
|
if (direction == Vector2.right)
|
|
|
|
|
{
|
|
|
|
|
if (frenzied)
|
|
|
|
|
return playerStats.m6ArcanaFrenzy;
|
|
|
|
|
else
|
|
|
|
|
return playerStats.m6Arcana;
|
|
|
|
|
}
|
|
|
|
|
return playerStats.m5Arcana;
|
2022-12-23 03:17:40 +02:00
|
|
|
}
|
2021-08-23 00:37:37 +02:00
|
|
|
}
|