convert game playing..
This commit is contained in:
@@ -3,6 +3,7 @@ using BumpCombat.Core;
|
||||
using BumpCombat.Constants;
|
||||
using BumpCombat.Enemies;
|
||||
using BumpCombat.Player;
|
||||
using BumpCombat.Progression;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BumpCombat.Combat
|
||||
@@ -12,6 +13,7 @@ namespace BumpCombat.Combat
|
||||
public sealed class BumpCombatResolver : MonoBehaviour
|
||||
{
|
||||
private float baseDamage => GameplayConstants.Current.Combat.BaseDamage;
|
||||
private bool enableFrontalBumpSelfDamage => GameplayConstants.Current.Combat.EnableFrontalBumpSelfDamage;
|
||||
private float dashDamage => GameplayConstants.Current.Combat.DashDamage;
|
||||
private float strongDashDamage => GameplayConstants.Current.Combat.StrongDashDamage;
|
||||
private float minimumAttackSpeed => GameplayConstants.Current.Combat.MinimumAttackSpeed;
|
||||
@@ -35,6 +37,7 @@ namespace BumpCombat.Combat
|
||||
private readonly Dictionary<int, float> nextNormalHitTimes = new();
|
||||
|
||||
private PlayerStats playerStats;
|
||||
private PlayerHealth playerHealth;
|
||||
private PlayerController playerController;
|
||||
private DashController dashController;
|
||||
private ActiveArtifactController activeArtifactController;
|
||||
@@ -43,6 +46,7 @@ namespace BumpCombat.Combat
|
||||
private void Awake()
|
||||
{
|
||||
playerStats = GetComponent<PlayerStats>();
|
||||
playerHealth = GetComponent<PlayerHealth>();
|
||||
playerController = GetComponent<PlayerController>();
|
||||
dashController = GetComponent<DashController>();
|
||||
activeArtifactController = GetComponent<ActiveArtifactController>();
|
||||
@@ -335,6 +339,10 @@ namespace BumpCombat.Combat
|
||||
playerStats.CalculateDamage(rawDamage, damageTag),
|
||||
side,
|
||||
isOffsetHit);
|
||||
finalDamage = PassiveRelicController.Instance?.ApplyOrdinaryBumpDamageMultiplier(
|
||||
finalDamage,
|
||||
!isDash && string.IsNullOrEmpty(sourceId),
|
||||
artifactColor.HasValue) ?? finalDamage;
|
||||
Vector2 knockbackDirection = -enemyToPlayer;
|
||||
bool suppressOrdinaryEventReaction = !isDash && isEventEnemy;
|
||||
float appliedKnockback = knockbackOverride
|
||||
@@ -361,7 +369,8 @@ namespace BumpCombat.Combat
|
||||
appliedKnockback,
|
||||
artifactColor.Value,
|
||||
castIdentity,
|
||||
!suppressOrdinaryEventReaction);
|
||||
!suppressOrdinaryEventReaction,
|
||||
EnemyDamageSource.Player);
|
||||
acceptedHit = artifactHitResult
|
||||
!= EnemyArtifactHitResult.Rejected;
|
||||
}
|
||||
@@ -372,7 +381,8 @@ namespace BumpCombat.Combat
|
||||
knockbackDirection,
|
||||
appliedKnockback,
|
||||
!suppressOrdinaryEventReaction,
|
||||
!isDash);
|
||||
!isDash,
|
||||
EnemyDamageSource.Player);
|
||||
}
|
||||
|
||||
if (!acceptedHit)
|
||||
@@ -477,16 +487,24 @@ namespace BumpCombat.Combat
|
||||
|
||||
if (!isDash && !protectionBegan)
|
||||
{
|
||||
if (!enemy.IsCrowd
|
||||
if (enableFrontalBumpSelfDamage
|
||||
&& !artifactColor.HasValue
|
||||
&& side == HitSide.Front)
|
||||
{
|
||||
playerHealth?.TryTakeDamage(
|
||||
enemy.ContactDamage,
|
||||
enemyToPlayer,
|
||||
enemy.PlayerKnockbackDistance);
|
||||
}
|
||||
else if (side != HitSide.Front
|
||||
&& !enemy.IsCrowd
|
||||
&& BumpCombatMath.AppliesPlayerImpactRecoil(side, isEventEnemy))
|
||||
{
|
||||
playerController.ApplyImpactRecoil(
|
||||
enemyToPlayer,
|
||||
side == HitSide.Front
|
||||
? frontPlayerImpactRecoilDistance
|
||||
: side == HitSide.Back && isEventEnemy
|
||||
? eventBackPlayerImpactRecoilDistance
|
||||
: playerImpactRecoilDistance);
|
||||
side == HitSide.Back && isEventEnemy
|
||||
? eventBackPlayerImpactRecoilDistance
|
||||
: playerImpactRecoilDistance);
|
||||
}
|
||||
activeArtifactController?.AddNormalHitCharge();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user