Implemented AuraType.ModMaxPower
This commit is contained in:
@@ -144,12 +144,12 @@ namespace Framework.Constants
|
|||||||
StatStamina,
|
StatStamina,
|
||||||
StatIntellect,
|
StatIntellect,
|
||||||
Health,
|
Health,
|
||||||
Mana, // MANA..RUNIC_POWER must be in existed order, it's accessed by index values of Powers enum.
|
Mana, // UNIT_MOD_MANA..UNIT_MOD_PAIN must be listed in existing order, it is accessed by index values of Powers enum.
|
||||||
Rage,
|
Rage,
|
||||||
Focus,
|
Focus,
|
||||||
Energy,
|
Energy,
|
||||||
Unused, // Old HAPPINESS
|
ComboPoints,
|
||||||
Rune,
|
Runes,
|
||||||
RunicPower,
|
RunicPower,
|
||||||
SoulShards,
|
SoulShards,
|
||||||
Eclipse,
|
Eclipse,
|
||||||
|
|||||||
@@ -553,7 +553,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
// Hunter trap: Search units which are unfriendly to the trap's owner
|
// Hunter trap: Search units which are unfriendly to the trap's owner
|
||||||
var checker = new NearestUnfriendlyNoTotemUnitInObjectRangeCheck(this, owner, radius);
|
var checker = new NearestUnfriendlyNoTotemUnitInObjectRangeCheck(this, owner, radius);
|
||||||
var searcher = new UnitSearcher(this, checker);
|
var searcher = new UnitLastSearcher(this, checker);
|
||||||
Cell.VisitAllObjects(this, searcher, radius);
|
Cell.VisitAllObjects(this, searcher, radius);
|
||||||
target = searcher.GetTarget();
|
target = searcher.GetTarget();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,9 +75,22 @@ namespace Game.Entities
|
|||||||
case UnitMods.Rage:
|
case UnitMods.Rage:
|
||||||
case UnitMods.Focus:
|
case UnitMods.Focus:
|
||||||
case UnitMods.Energy:
|
case UnitMods.Energy:
|
||||||
case UnitMods.Rune:
|
case UnitMods.ComboPoints:
|
||||||
|
case UnitMods.Runes:
|
||||||
case UnitMods.RunicPower:
|
case UnitMods.RunicPower:
|
||||||
UpdateMaxPower(GetPowerTypeByAuraGroup(unitMod));
|
case UnitMods.SoulShards:
|
||||||
|
case UnitMods.Eclipse:
|
||||||
|
case UnitMods.HolyPower:
|
||||||
|
case UnitMods.Alternative:
|
||||||
|
case UnitMods.Maelstrom:
|
||||||
|
case UnitMods.Chi:
|
||||||
|
case UnitMods.Insanity:
|
||||||
|
case UnitMods.BurningEmbers:
|
||||||
|
case UnitMods.DemonicFury:
|
||||||
|
case UnitMods.ArcaneCharges:
|
||||||
|
case UnitMods.Fury:
|
||||||
|
case UnitMods.Pain:
|
||||||
|
UpdateMaxPower((PowerType)(unitMod - UnitMods.PowerStart));
|
||||||
break;
|
break;
|
||||||
case UnitMods.ResistanceHoly:
|
case UnitMods.ResistanceHoly:
|
||||||
case UnitMods.ResistanceFire:
|
case UnitMods.ResistanceFire:
|
||||||
@@ -173,25 +186,6 @@ namespace Game.Entities
|
|||||||
|
|
||||||
return stat;
|
return stat;
|
||||||
}
|
}
|
||||||
PowerType GetPowerTypeByAuraGroup(UnitMods unitMod)
|
|
||||||
{
|
|
||||||
switch (unitMod)
|
|
||||||
{
|
|
||||||
case UnitMods.Rage:
|
|
||||||
return PowerType.Rage;
|
|
||||||
case UnitMods.Focus:
|
|
||||||
return PowerType.Focus;
|
|
||||||
case UnitMods.Energy:
|
|
||||||
return PowerType.Energy;
|
|
||||||
case UnitMods.Rune:
|
|
||||||
return PowerType.Runes;
|
|
||||||
case UnitMods.RunicPower:
|
|
||||||
return PowerType.RunicPower;
|
|
||||||
default:
|
|
||||||
case UnitMods.Mana:
|
|
||||||
return PowerType.Mana;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ApplyStatBuffMod(Stats stat, float val, bool apply)
|
public void ApplyStatBuffMod(Stats stat, float val, bool apply)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3587,6 +3587,20 @@ namespace Game.Spells
|
|||||||
target.UpdateAttackPowerAndDamage(true);
|
target.UpdateAttackPowerAndDamage(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[AuraEffectHandler(AuraType.ModMaxPower)]
|
||||||
|
void HandleAuraModMaxPower(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
|
{
|
||||||
|
if (!mode.HasAnyFlag(AuraEffectHandleModes.ChangeAmountMask | AuraEffectHandleModes.Stat))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Unit target = aurApp.GetTarget();
|
||||||
|
|
||||||
|
PowerType power = (PowerType)GetMiscValue();
|
||||||
|
UnitMods unitMod = (UnitMods)(UnitMods.PowerStart + (int)power);
|
||||||
|
|
||||||
|
target.HandleStatModifier(unitMod, UnitModifierType.TotalValue, GetAmount(), apply);
|
||||||
|
}
|
||||||
|
|
||||||
/********************************/
|
/********************************/
|
||||||
/*** HEAL & ENERGIZE ***/
|
/*** HEAL & ENERGIZE ***/
|
||||||
/********************************/
|
/********************************/
|
||||||
|
|||||||
Reference in New Issue
Block a user