Skip to content

Commit 79857f5

Browse files
authored
Merge pull request #16 from openrpg/feature/effect-stat-refresh
Feature/effect stat refresh
2 parents 751d56c + 5366c76 commit 79857f5

36 files changed

+286
-188
lines changed

.github/workflows/build-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build And Test
22
on: [push]
33

44
env:
5-
BuildVersion: '0.42.${{github.run_number}}'
5+
BuildVersion: '0.43.${{github.run_number}}'
66
SolutionFile: 'src/OpenRpg.sln'
77
DemoProject: 'src/OpenRpg.Demos.Web/OpenRpg.Demos.Web.csproj'
88
EditorProject: 'src/OpenRpg.Editor/OpenRpg.Editor.csproj'

docs/genres.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The `Genres` project is a layering/contractual approach that allows you to expre
99
You maybe don't, but if we take a step back and think about more RPG games, there are some common themes/settings/mechanics at play, for example if is list some common `Fantasy` themes:
1010
- They often have some form of *Human*, *Dwarf*, *Elf* `Races`
1111
- They often have some form of *Fighter*, *Rogue*, *Mage* `Classes`
12-
- They often have the notion of `Health` and `Magic`
12+
- They often have the notion of `Health` and `Mana`
1313
- They often have different kinds of `Damage` like *Blunt*, *Fire*, *Wind*, *Piercing*
1414
- You can often equip *weapons*, *chest/leg/shoulder/hand* items
1515
- You can often modify your equipment with *runes/gems/enchantments*
@@ -31,9 +31,9 @@ The other **REALLY IMPORTANT** thing it provides is a contract so everyone using
3131

3232
As mentioned above this provides some out the box functionality and type data for common Fantasy themes, so at a high level things like:
3333
- Fantasy Stat Types (Strength, Dexterity etc)
34-
- Fantasy State Types (Health, Magic)
34+
- Fantasy State Types (Health, Mana)
3535
- Fantasy Damage/Defense Types (Fire, Ice, Wind, Slash, Blunt etc)
36-
- Fantasy Effect Types (Strength Bonus Amount/Percentage, Magic Restore Speed etc)
36+
- Fantasy Effect Types (Strength Bonus Amount/Percentage, Mana Restore Speed etc)
3737

3838
> There is so much more and its recommended you check over the classes in the `Types`, `Extensions` namespaces for exact additions this library provides.
3939

src/OpenRpg.Demos.Infrastructure/Data/ClassTemplateDataGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public ClassTemplate GenerateMageClass()
4949
new StaticEffect {Potency = 4, EffectType = FantasyEffectTypes.IntelligenceBonusAmount},
5050
new StaticEffect {Potency = 10, EffectType = FantasyEffectTypes.DarkDamageAmount},
5151
new StaticEffect {Potency = 10, EffectType = FantasyEffectTypes.DarkDefenseAmount},
52-
new StaticEffect {Potency = 30, EffectType = FantasyEffectTypes.MagicBonusAmount}
52+
new StaticEffect {Potency = 30, EffectType = FantasyEffectTypes.ManaBonusAmount}
5353
};
5454

5555
var classTemplate = new ClassTemplate

src/OpenRpg.Demos.Infrastructure/Data/RaceTemplateDataGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public RaceTemplate GenerateHumanTemplate()
3131
new StaticEffect {Potency = 1, EffectType = FantasyEffectTypes.DarkDamageAmount},
3232
new StaticEffect {Potency = 5, EffectType = FantasyEffectTypes.DarkDefenseAmount},
3333
new StaticEffect {Potency = 80, EffectType = FantasyEffectTypes.HealthBonusAmount},
34-
new StaticEffect {Potency = 10, EffectType = FantasyEffectTypes.MagicBonusAmount}
34+
new StaticEffect {Potency = 10, EffectType = FantasyEffectTypes.ManaBonusAmount}
3535
};
3636

3737
var raceTemplate = new RaceTemplate
@@ -60,7 +60,7 @@ public RaceTemplate GenerateElfTemplate()
6060
new StaticEffect {Potency = 5, EffectType = FantasyEffectTypes.DarkDamageAmount},
6161
new StaticEffect {Potency = 10, EffectType = FantasyEffectTypes.DarkDefenseAmount},
6262
new StaticEffect {Potency = 70, EffectType = FantasyEffectTypes.HealthBonusAmount},
63-
new StaticEffect {Potency = 30, EffectType = FantasyEffectTypes.MagicBonusAmount}
63+
new StaticEffect {Potency = 30, EffectType = FantasyEffectTypes.ManaBonusAmount}
6464
};
6565

6666
var raceTemplate = new RaceTemplate

src/OpenRpg.Demos.Web/Components/Characters/CharacterVitals.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<progress class="progress is-danger" value="@State.Health().ToString()" max="@Stats.MaxHealth().ToString()"></progress>
1313
</div>
1414
<div class="column">
15-
<h4 class="subtitle mb-2 has-text-dark has-text-centered">Magic</h4>
16-
<progress class="progress is-info" value="@State.Magic().ToString()" max="@Stats.MaxMagic().ToString()"></progress>
15+
<h4 class="subtitle mb-2 has-text-dark has-text-centered">Mana</h4>
16+
<progress class="progress is-info" value="@State.Mana().ToString()" max="@Stats.MaxMana().ToString()"></progress>
1717
</div>
1818
</div>
1919
}

src/OpenRpg.Demos.Web/Pages/Curves/AdvancedEffects.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
So far everything you have been touching on uses the `StaticEffect` behind the scenes which expresses an `EffectType`
3737
and a `Potency`, however the potency is a fixed value, so if its 10, its always going to be 10. For most use cases
3838
this is perfectly fine, however imagine if you were making a Souls-like game and you wanted to make a weapon whos
39-
`Damage` stat scaled with your `Strength` stat, or if your `Necromancer` class got a `MaxMagic` boost at night time.
39+
`Damage` stat scaled with your `Strength` stat, or if your `Necromancer` class got a `MaxMana` boost at night time.
4040

4141
`ScaledEffects` let you achieve these sorts of use cases by replacing the static `Potency` with a `PotencyFunction`
4242
that allows us to *compute* the effects potency based off other factors and plot it on a curve.

src/OpenRpg.Demos.Web/Pages/Entities/AdvancedStats.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
To get around this we try to think about the differences between static vs dynamic data in persistence terms and you generally
5858
want to cull all static data on persistence actions as it should all be regenerated when the character is loaded in, the only data
59-
that REALLY needs persisting from the stats is dynamic data like Health and Magic and any other `State` variables you add.
59+
that REALLY needs persisting from the stats is dynamic data like Health and Mana and any other `State` variables you add.
6060
</Markdown>
6161

6262
<br/>

src/OpenRpg.Demos.Web/Pages/Entities/CharacterStatsComponents.razor

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
var character = new DefaultEntity();
4545

4646
character.Stats.MaxHealth(100);
47-
character.Stats.MaxMagic(10);
47+
character.Stats.MaxMana(10);
4848
character.Stats.Strength(11);
4949
character.Stats.Dexterity(12);
5050
character.Stats.Intelligence(12);
@@ -101,7 +101,7 @@
101101
new Effect {Potency = 1, EffectType = FantasyEffectTypes.DarkDamageAmount},
102102
new Effect {Potency = 5, EffectType = FantasyEffectTypes.DarkDefenseAmount},
103103
new Effect {Potency = 50, EffectType = FantasyEffectTypes.HealthBonusAmount},
104-
new Effect {Potency = 10, EffectType = FantasyEffectTypes.MagicBonusAmount}
104+
new Effect {Potency = 10, EffectType = FantasyEffectTypes.ManaBonusAmount}
105105
};
106106

107107
var classEffects = new[]
@@ -228,8 +228,8 @@
228228
ManualStatsExample.Stats = new EntityStatsVariables();
229229
ManualStatsExample.Stats.MaxHealth(100);
230230
ManualStatsExample.State.Health(50);
231-
ManualStatsExample.Stats.MaxMagic(10);
232-
ManualStatsExample.State.Magic(7);
231+
ManualStatsExample.Stats.MaxMana(10);
232+
ManualStatsExample.State.Mana(7);
233233

234234
ManualStatsExample.Stats.Strength(11);
235235
ManualStatsExample.Stats.Dexterity(12);
@@ -259,7 +259,7 @@
259259
new StaticEffect {Potency = 1, EffectType = FantasyEffectTypes.DarkDamageAmount},
260260
new StaticEffect {Potency = 5, EffectType = FantasyEffectTypes.DarkDefenseAmount},
261261
new StaticEffect {Potency = 50, EffectType = FantasyEffectTypes.HealthBonusAmount},
262-
new StaticEffect {Potency = 10, EffectType = FantasyEffectTypes.MagicBonusAmount}
262+
new StaticEffect {Potency = 10, EffectType = FantasyEffectTypes.ManaBonusAmount}
263263
};
264264

265265
var classEffects = new[]

src/OpenRpg.Demos.Web/Pages/Entities/DefaultEntityClasses.razor

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
character.Class = new DefaultCharacterClass(3, new DefaultClassTemplate { NameLocaleId = "Fighter" });
4545
character.Stats.MaxHealth(100);
4646
character.State.Health(50);
47-
character.Stats.MaxMagic(10);
48-
character.State.Magic(7);
47+
character.Stats.MaxMana(10);
48+
character.State.Mana(7);
4949
character.Stats.Strength(11);
5050
character.Stats.Dexterity(12);
5151
character.Stats.Intelligence(12);
@@ -147,8 +147,8 @@
147147

148148
_manualCharacter.Stats.MaxHealth(100);
149149
_manualCharacter.State.Health(50);
150-
_manualCharacter.Stats.MaxMagic(10);
151-
_manualCharacter.State.Magic(7);
150+
_manualCharacter.Stats.MaxMana(10);
151+
_manualCharacter.State.Mana(7);
152152

153153
_manualCharacter.Stats.Strength(11);
154154
_manualCharacter.Stats.Dexterity(12);

src/OpenRpg.Demos.Web/Pages/Items/ItemsWithModifications.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
new StaticEffect { EffectType = FantasyEffectTypes.DamageBonusAmount, Potency = 15.0f },
158158
new StaticEffect { EffectType = FantasyEffectTypes.DarkDamageAmount, Potency = 30.0f },
159159
new StaticEffect { EffectType = FantasyEffectTypes.IntelligenceBonusAmount, Potency = 5.0f },
160-
new StaticEffect { EffectType = FantasyEffectTypes.MagicBonusAmount, Potency = 40.0f }
160+
new StaticEffect { EffectType = FantasyEffectTypes.ManaBonusAmount, Potency = 40.0f }
161161
}
162162
};
163163
template.Variables.QualityType(FantasyItemQualityTypes.RareQuality);

0 commit comments

Comments
 (0)