SetNet.Abilities
1.2.0
dotnet add package SetNet.Abilities --version 1.2.0
NuGet\Install-Package SetNet.Abilities -Version 1.2.0
<PackageReference Include="SetNet.Abilities" Version="1.2.0" />
<PackageVersion Include="SetNet.Abilities" Version="1.2.0" />
<PackageReference Include="SetNet.Abilities" />
paket add SetNet.Abilities --version 1.2.0
#r "nuget: SetNet.Abilities, 1.2.0"
#:package SetNet.Abilities@1.2.0
#addin nuget:?package=SetNet.Abilities&version=1.2.0
#tool nuget:?package=SetNet.Abilities&version=1.2.0
<p align="center"> <img src="https://raw.githubusercontent.com/Povstalez/SetNet/master/assets/icon.png" alt="SetNet" width="96"> </p>
SetNet.Abilities
Server-authoritative abilities and skills for SetNet.
Define abilities with a cooldown, resource cost, range and target kind, plus composable effects — DamageEffect (through SetNet.Combat), HealEffect, and BuffEffect (a timed SetNet.Stats modifier). Clients request an ability; the server validates cooldown/cost/target/range and applies the effects. Entity stats, health, positions and resources all come through seams, so mobs and players run through the exact same system. Added by composition — no base class.
Install
dotnet add package SetNet
dotnet add package SetNet.Abilities
Usage
Call AbilitiesRuntime.Enable() once at startup on both ends.
Server — wire the seams to your entity state, then Define abilities:
AbilitiesRuntime.Enable();
var abilities = server.UseAbilities(new AbilityOptions
{
StatsOf = key => world.StatsOf(key), // string key -> StatSet?
HealthOf = key => world.HealthOf(key), // string key -> Health?
PositionOf = key => world.PositionOf(key), // for range checks (null disables them)
ResourceOf = (key, id) => world.ResourceOf(key, id), // mana/energy pools
});
abilities.Define(new AbilityDefinition
{
Id = "fireball", CooldownMs = 3000, Range = 30,
ResourceId = "mana", ResourceCost = 20,
TargetKind = TargetKind.Target,
Effects = { new DamageEffect(coefficient: 1.5, damageType: "fire") },
});
// server/mob logic can fire it directly through the same entry point:
AbilityOutcome outcome = await abilities.TryUseAsync("mob:dragon#7", "fireball", AbilityTarget.Of(playerKey));
Client — request a use; the server is the authority:
AbilitiesRuntime.Enable();
var abilities = client.UseAbilities();
var outcome = await abilities.UseAsync("fireball", targetKey: enemyId);
if (!outcome.Ok) Toast(outcome.Message); // "on cooldown", "out of range", "not enough mana", …
else StartCooldownUi(outcome.CooldownMs);
Notes
TryUseAsyncis the one gate. Both client requests and server/mob logic go through it: it validates cooldown → target → range → resource cost, starts the cooldown before applying (so a throwing effect can't be spammed), then runs each effect. A bad effect is caught so it can't abort the rest.- Composable effects. Drop
DamageEffect,HealEffect,BuffEffectintoAbilityDefinition.Effects, or implementIAbilityEffectfor your own.BuffEffectapplies re-tagged stat modifiers and auto-removes them after its duration. - Seams, not subclasses.
AbilityOptionsresolves stats/health/position/resource from entity keys, so the same abilities work for players and mobs. SetPlayerKeyto map a peer to its stable key (default = connection id — override to the authenticated account id, matching your other hubs). - Targeting.
TargetKind(None/Self/Target/Point) plusAbilityTarget.Of(key)/At(point). Range is enforced only whenPositionOfis set. - Rides the unified SetNet.Protocol messaging layer on the
Channels.Abilitieschannel (all modules share one envelope wire type,65447) — no per-module wire ids to reserve. The control protocol is hand-framedbyte[].
Documentation & source
- 🐙 https://github.com/Povstalez/SetNet — full module catalog in docs/MODULES.md
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- SetNet (>= 1.2.0)
- SetNet.Combat (>= 1.2.0)
- SetNet.Stats (>= 1.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.0 | 109 | 8/5/2026 |