Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Collections.Generic;
using OpenRpg.Entities.Stats.Variables;
using OpenRpg.Genres.Fantasy.Types;

Expand All @@ -23,7 +24,9 @@ public static class EntityStatVariableExtensions

public static void ManaRegen(this EntityStatsVariables stats, float value) => stats[FantasyEntityStatsVariableTypes.ManaRegen] = value;
public static float ManaRegen(this EntityStatsVariables stats) => stats.Get(FantasyEntityStatsVariableTypes.ManaRegen);

public static float ManaRegenRate(this EntityStatsVariables stats) => stats.Get(FantasyEntityStatsVariableTypes.ManaRegenRate);
public static void ManaRegenRate(this EntityStatsVariables stats, float regenRate) => stats[FantasyEntityStatsVariableTypes.ManaRegenRate] = regenRate;

public static float IceDamage(this EntityStatsVariables stats) => stats.Get(FantasyEntityStatsVariableTypes.IceDamage);
public static float FireDamage(this EntityStatsVariables stats) => stats.Get(FantasyEntityStatsVariableTypes.FireDamage);
public static float WindDamage(this EntityStatsVariables stats) => stats.Get(FantasyEntityStatsVariableTypes.WindDamage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ public void Populate(EntityStatsVariables stats, ComputedEffects computedEffects
stats.ManaRegen(computedEffects.CalculateTotalValueFor(FantasyEffectTypes.ManaRegenBonusAmount, FantasyEffectTypes.ManaRegenBonusPercentage));
stats.StaminaRegen(computedEffects.CalculateTotalValueFor(FantasyEffectTypes.StaminaRegenBonusAmount, FantasyEffectTypes.StaminaRegenBonusPercentage));

stats.HealthRegenRate(computedEffects.CalculateTotalValueFor(FantasyEffectTypes.HealthRegenRateBonusAmount, FantasyEffectTypes.HealthRegenRateBonusPercentage));
stats.ManaRegenRate(computedEffects.CalculateTotalValueFor(FantasyEffectTypes.ManaRegenRateBonusAmount, FantasyEffectTypes.ManaRegenRateBonusPercentage));
stats.StaminaRegenRate(computedEffects.CalculateTotalValueFor(FantasyEffectTypes.StaminaRegenRateBonusAmount, FantasyEffectTypes.StaminaRegenRateBonusPercentage));

stats.MovementSpeed(computedEffects.CalculateTotalValueFor(FantasyEffectTypes.MovementSpeedBonusAmount, FantasyEffectTypes.MovementSpeedBonusPercentage));
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/OpenRpg.Genres.Fantasy/Types/FantasyEffectTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public interface FantasyEffectTypes : Genres.Types.GenreEffectTypes
public static readonly int ManaBonusPercentage = 235;
public static readonly int ManaRestoreAmount = 236;
public static readonly int ManaRestorePercentage = 237;

public static readonly int ManaRegenRateBonusAmount = 238;
public static readonly int ManaRegenRateBonusPercentage = 239;

// Melee Damage (Damage Types)
public static readonly int SlashingDamageAmount = 260;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ namespace OpenRpg.Genres.Fantasy.Types
{
public interface FantasyEntityStatsVariableTypes : Genres.Types.GenreEntityStatsVariableTypes
{
// Mana stats
public static readonly int MaxMana = 50;
public static readonly int ManaRegen = 51;
public static readonly int ManaRegenRate = 52;

// Base stats
public static readonly int Strength = 60;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ public static class EntityStatVariableExtensions

public static float HealthRegen(this EntityStatsVariables stats) => stats.GetValueOrDefault(GenreEntityStatsVariableTypes.HealthRegen, 0);
public static void HealthRegen(this EntityStatsVariables stats, float staminaRegen) => stats[GenreEntityStatsVariableTypes.HealthRegen] = staminaRegen;

public static float StaminaRegen(this EntityStatsVariables stats) => stats.GetValueOrDefault(GenreEntityStatsVariableTypes.StaminaRegen, 0);
public static void StaminaRegen(this EntityStatsVariables stats, float staminaRegen) => stats[GenreEntityStatsVariableTypes.StaminaRegen] = staminaRegen;

public static float HealthRegenRate(this EntityStatsVariables stats) => stats.GetValueOrDefault(GenreEntityStatsVariableTypes.HealthRegenRate, 0);
public static void HealthRegenRate(this EntityStatsVariables stats, float regenRate) => stats[GenreEntityStatsVariableTypes.HealthRegenRate] = regenRate;
public static float StaminaRegenRate(this EntityStatsVariables stats) => stats.GetValueOrDefault(GenreEntityStatsVariableTypes.StaminaRegenRate, 0);
public static void StaminaRegenRate(this EntityStatsVariables stats, float regenRate) => stats[GenreEntityStatsVariableTypes.StaminaRegenRate] = regenRate;

public static float MovementSpeed(this EntityStatsVariables stats) => stats.GetValueOrDefault(GenreEntityStatsVariableTypes.MovementSpeed, 0);
public static void MovementSpeed(this EntityStatsVariables stats, float movementSpeed) => stats[GenreEntityStatsVariableTypes.MovementSpeed] = movementSpeed;
}
Expand Down
5 changes: 5 additions & 0 deletions src/OpenRpg.Genres/Types/GenreEffectTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ public interface GenreEffectTypes
public static readonly int StaminaRestorePercentage = 69;
public static readonly int StaminaRegenBonusAmount = 70;
public static readonly int StaminaRegenBonusPercentage = 71;
public static readonly int HealthRegenRateBonusAmount = 72;
public static readonly int HealthRegenRateBonusPercentage = 73;
public static readonly int StaminaRegenRateBonusAmount = 74;
public static readonly int StaminaRegenRateBonusPercentage = 75;


// Ability Related
public static readonly int AttackRangeBonusAmount = 90;
Expand Down
2 changes: 2 additions & 0 deletions src/OpenRpg.Genres/Types/GenreEntityStatsVariableTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public interface GenreEntityStatsVariableTypes : CoreEntityStatsVariableTypes
public static readonly int MaxStamina = 3;
public static readonly int StaminaRegen = 4;
public static readonly int MovementSpeed = 5;
public static readonly int HealthRegenRate = 6;
public static readonly int StaminaRegenRate = 7;

// Attack stats
public static readonly int Damage = 10;
Expand Down
Loading