コード例 #1
0
        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();
        }
コード例 #2
0
 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();
     }
 }
コード例 #3
0
 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;
     }
 }
コード例 #4
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);
            }
        }