fix: Optimizes TextDefinition to eliminate allocations. Removes TextDefinition ctor. (#1221)

### BREAKING CHANGE ###
The constructor for `TextDefinition` has been removed. Instead use `TextDefinition.Of()` or cast the integer/string to TextDefinition.
This commit is contained in:
Kamron Batman 2022-10-30 16:53:23 -07:00 • committed by GitHub
parent 213b7025af
commit 910e06767b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 790 additions and 722 deletions

View file

@ -10,8 +10,8 @@ namespace Server.Spells.Bushido
public override int BaseMana => 0;
public override double RequiredSkill => 25.0;
public override TextDefinition AbilityMessage =>
new(1063122); // You better kill your enemy with your next hit or you'll be rather sorry...
// You better kill your enemy with your next hit or you'll be rather sorry...
public override TextDefinition AbilityMessage { get; } = 1063122;
public override double GetDamageScalar(Mobile attacker, Mobile defender) =>
// TODO: 20 -> Perfection

View file

@ -7,7 +7,7 @@ namespace Server.Spells.Bushido
public override int BaseMana => 5;
public override double RequiredSkill => 50.0;
public override TextDefinition AbilityMessage => new(1063167); // You prepare to strike quickly.
public override TextDefinition AbilityMessage { get; } = 1063167; // You prepare to strike quickly.
public override bool DelayedContext => true;

View file

@ -7,8 +7,8 @@ namespace Server.Spells.Bushido
public override int BaseMana => 10;
public override double RequiredSkill => 70.0;
public override TextDefinition AbilityMessage =>
new(1070757); // You prepare to strike two enemies with one blow.
// You prepare to strike two enemies with one blow.
public override TextDefinition AbilityMessage { get; } = 1070757;
public override void OnHit(Mobile attacker, Mobile defender, int damage)
{