feat: Adds reflect damage ability. Fixes magical barrier (#1184)

This commit is contained in:
Kamron Batman 2022-10-08 10:39:28 -07:00 • committed by GitHub
parent 3c5e9eaec9
commit 2806e5d4b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 86 additions and 64 deletions

View file

@ -14,5 +14,6 @@ public enum MonsterAbilityType
DeathExplosion,
MassDrainLife,
MagicalBarrier,
EnergyBoltCounter
EnergyBoltCounter,
ReflectPhysicalDamage
}

View file

@ -0,0 +1,11 @@
namespace Server.Mobiles;
public class ReflectPhysicalDamage : MonsterAbility
{
// This is handled manually in AOS.Damage()
public override MonsterAbilityTrigger AbilityTrigger => MonsterAbilityTrigger.CombatAction;
public override MonsterAbilityType AbilityType => MonsterAbilityType.ReflectPhysicalDamage;
public virtual int PercentReflected => 10;
}

View file

@ -64,6 +64,9 @@ namespace Server.Mobiles
public override bool Uncalmable => true;
private static MonsterAbility[] _abilities = { new ReflectPhysicalDamage() };
public override MonsterAbility[] GetMonsterAbilities() => _abilities;
public override void GenerateLoot()
{
AddLoot(LootPack.FilthyRich);
@ -71,12 +74,6 @@ namespace Server.Mobiles
AddLoot(LootPack.Gems, 2);
}
/* TODO: Repel Magic
* 10% chance of repelling a melee attack (why did they call it repel magic anyway?)
* Cliloc: 1070844
* Effect: damage is dealt to the attacker, no damage is taken by the fan dancer
*/
private void ThrowFan(Mobile to)
{
if (!(Utility.RandomDouble() < 0.8) || to.InRange(this, 1))