This commit is contained in:
SoulliesOfficial
2026-01-03 18:19:39 -05:00
parent 3bcd7c1cf8
commit 33b1795c1f
7387 changed files with 2762819 additions and 716926 deletions

View File

@@ -22,7 +22,7 @@ namespace Cielonos.MainGame.Characters
public partial class CharacterBase : SerializedMonoBehaviour
{
public Fraction fraction;
public Transform flexibleCenterPoint;
public Transform flexibleCenterPoint => bodyPartsSc.flexibleCenterPoint;
public Transform footPoint;
[TitleGroup("Data & Presets")]
@@ -53,23 +53,17 @@ namespace Cielonos.MainGame.Characters
[TitleGroup("Navigation")]
public HUDNavigationElement navigationElement;
protected virtual void Awake()
{
InitializeSubcontrollers();
InitializeSubmodules();
}
#if UNITY_EDITOR
private void Reset()
protected void Awake()
{
InitializeSubmodules();
InitializeSubcontrollers();
}
#endif
protected virtual void Start()
{
vfxData.Initialize(this);
vfxData?.Initialize(this);
selfTimeSm?.SetUp(this);
if (fraction == Fraction.Enemy)
{
@@ -116,8 +110,12 @@ namespace Cielonos.MainGame.Characters
public partial class CharacterBase
{
public AttackResult DealAttack(AttackValue attackValue, out bool isDead)
public AttackResult GetAttacked(AttackAreaBase attackArea, out bool isDead)
{
eventSm.onBeforeGetAttacked.Invoke(attackArea);
AttackValue attackValue = attackArea.attackSm.attackValue;
AttackResult result = new AttackResult(attackValue.damage);
/*if (statusModule.IsInvincible)
@@ -127,7 +125,7 @@ namespace Cielonos.MainGame.Characters
return finalDamage;
}*/
float finalDamage = GetDamageValueAfterResistance(attackValue);
float finalDamage = GetFinalDamageValue(attackValue);
if (attributeSm.HasAttribute("Shield") && attributeSm["Shield"] > 0)
{
@@ -163,20 +161,17 @@ namespace Cielonos.MainGame.Characters
return result;
}
public float GetDamageValueAfterResistance(AttackValue attackValue)
public float GetFinalDamageValue(AttackValue attackValue)
{
/*float reductionRate = attributeModule.currentAttributes.TryGetValue("DamageReduction", out float rate) ? rate : 0;
return attackValue.attackType switch
{
AttackType.Energy => attackValue.damage * GetDamageReduction(attributeModule.GetCurrentAttribute("EnergyAttackResistance"), reductionRate),
AttackType.Kinetics => attackValue.damage * GetDamageReduction(attributeModule.GetCurrentAttribute("KineticAttackResistance"), reductionRate),
AttackType.Explosion => attackValue.damage * GetDamageReduction(attributeModule.GetCurrentAttribute("ExplosionAttackResistance"), reductionRate),
AttackType.Magic => attackValue.damage * GetDamageReduction(attributeModule.GetCurrentAttribute("MagicAttackResistance"), reductionRate),
AttackType.Elemental => attackValue.damage * GetDamageReduction(attributeModule.GetCurrentAttribute("ElementalAttackResistance"), reductionRate),
AttackType.Pure => attackValue.damage * GetDamageReduction(0, reductionRate),
_ => throw new ArgumentOutOfRangeException()
};*/
string dmByAttackType = attackValue.attackType.ToString() + "DamageDealtMultiplier";
string gmByAttackType = attackValue.attackType.ToString() + "DamageGainMultiplier";
attackValue.damage *= attackValue.attacker.attributeSm[dmByAttackType];
attackValue.damage *= attributeSm[gmByAttackType];
attackValue.damage *= attackValue.attacker.attributeSm["FinalDamageDealtMultiplier"];
attackValue.damage *= attributeSm["FinalDamageGainMultiplier"];
return attackValue.damage;
}
}
@@ -206,7 +201,7 @@ namespace Cielonos.MainGame.Characters
recoveryTime = 0f;
break;
}
Debug.Log($"GetHit Disruption Animation Played: {disruptionType} - {breakthroughType}, Recovery Time: {recoveryTime}");
return true;
}