Many changes to Invector inventory system, added WIP UI system, added implementation for max stamina, moving speed, attack speed, attack power, thorns

This commit is contained in:
2025-12-05 15:10:52 +01:00
parent 53fa05e246
commit af7706bfac
21 changed files with 2352 additions and 3868 deletions

View File

@@ -26,7 +26,13 @@ namespace Invector.vMelee
public vMeleeWeapon leftWeapon, rightWeapon;
public vOnHitEvent onDamageHit, onRecoilHit;
public OnEquipWeaponEvent onEquipWeapon;
protected float globalDamageMultiplier = 1f;
// CHANGE 2: Add a public method to set this multiplier from Player.cs
public void SetGlobalDamageMultiplier(float multiplier)
{
globalDamageMultiplier = multiplier;
}
#endregion SeralizedProperties in CustomEditor
[Tooltip("NPC ONLY- Ideal distance for the attack")]
@@ -184,10 +190,24 @@ namespace Invector.vMelee
if (this.attackName != string.Empty) damage.damageType = this.attackName;
if (this.ignoreDefense) damage.ignoreDefense = this.ignoreDefense;
if (this.senselessTime != 0) damage.senselessTime = this.senselessTime;
/// Calc damage with multiplier
/// and Call ApplyDamage of attackObject
damage.damageValue *= damageMultiplier > 1 ? damageMultiplier : 1;
// CHANGE 3: Update the Math to include your global multiplier
// -----------------------------------------------------------
float calculatedDamage = damage.damageValue;
// 1. Apply Animation Multiplier (Heavy attacks, etc)
if (damageMultiplier > 1) calculatedDamage *= damageMultiplier;
// 2. Apply Trinket/Global Multiplier
calculatedDamage *= globalDamageMultiplier;
// 3. Apply Result back to the integer (Rounding to nearest)
damage.damageValue = Mathf.RoundToInt(calculatedDamage);
// -----------------------------------------------------------
hitInfo.targetIsBlocking = !hitInfo.attackObject.ApplyDamage(hitInfo.hitBox, hitInfo.targetCollider, damage);
onDamageHit.Invoke(hitInfo);