public override void Process(IBattleEntity attacker, IBattleEntity target) { float hitprobability = MathCore.Sigmoid(GetModifiedDexterity(attacker) - target.Dexterity, 1.1f, 0.68f); RPGMessageBuilder message = context.GetModule <RPGMessageModule>().Create().BattleActor(attacker).Text(" tries to bite ").BattleActor(target); if (RNG.XORShift64.NextFloat() < hitprobability) { int hp = Math.Min(target.HP, (int)(target.MaxHP * (0.1 + 0.05 * Level))); message.Text(", sucks on him and heals").Health(attacker.Heal(hp)).Text("."); target.Hit(hp); } else { message.Text(" but fails miserably."); } message.Send(); }
public void ProcessStatusEffect(double time) { cooldown -= time; if (cooldown <= 0) { int damage = Math.Max(1, (int)(GetDamage() * (0.5 + RNG.XORShift64.NextDouble() * 0.5))); RPGMessageBuilder message = messages.Create().Text("The ").Color(AdventureColors.Poison).Text("Poison").Reset().Text(" is draining the body of ").BattleActor(target).Text(" for ").Damage(damage).Text(".").Reset(); target.Hit(damage); if (target.HP <= 0) { target.BattleLogic.Remove(target); message.Text(" ").BattleActor(target).Text(" dies to the ").Color(AdventureColors.Poison).Text("Poison").Reset().Text("."); adventuremodule.ChangeStatus(target.Adventure, AdventureStatus.SpiritRealm); } message.Send(); cooldown += GetCooldown(); } }
public void ProcessStatusEffect(double time) { cooldown -= time; if (cooldown <= 0) { if (RNG.XORShift64.NextFloat() < GetSuppurationChance()) { RPGMessageBuilder message = messages.Create(); int damage = Math.Max(1, (int)(GetDamage() * (0.5 + RNG.XORShift64.NextDouble() * 0.5))); message.Text("The wound of ").BattleActor(target).Text(" suppurates, inflicting pain for ").Damage(damage).Text("."); target.Hit(damage); if (target.HP <= 0) { target.BattleLogic.Remove(target, message); } message.Send(); } cooldown += 5.0; } }
AdventureStatus ProcessEffectResult(EffectResult result, IBattleEntity attacker, IBattleEntity target, RPGMessageBuilder message) { if (result == null) { return(AdventureStatus.MonsterBattle); } switch (result.Type) { case EffectResultType.DamageSelf: attacker.Hit((int)result.Argument); return(CheckStatus(attacker, target, message)); case EffectResultType.NewEffectTarget: (target as MonsterBattleEntity)?.AddEffect((ITemporaryEffect)result.Argument); return(AdventureStatus.MonsterBattle); default: return(AdventureStatus.MonsterBattle); } }