Exemplo n.º 1
0
        public RPGDamage GetActorCurrentDamage(Actor a)
        {
            // go through attack of actor's weapon and bonuses, effects, etc.
            RPGDamage dmg = new RPGDamage(a);

            return(dmg);
        }
Exemplo n.º 2
0
        public void DamageMe(RPGDamage dmg)
        {
            // for now, just go to the easy one...
            DamageMe(dmg.Physical);

            // go through damage object and apply all damages that apply to this actor.

            // then check for death
            //if (this.HPCurrent <= 0)
            //{
            //    ApplyDeath();
            //}
        }
Exemplo n.º 3
0
        private void AttemptMeleeAttack()
        {
            lastAttack = DateTime.Now;

            // hit melee
            switch (new RPGCalc().AttemptHit(this, (Actor)currentAction.target))
            {
            case (RPGCalc.ChallangeResult.Critical_Failure):     // crit miss
            {
                // draw a 'miss' on target
                ((Actor)currentAction.target).MissedMe();

                // - maybe damage self?

                break;
            }

            case (RPGCalc.ChallangeResult.Failure):     // miss
            {
                // draw a 'miss' on target
                ((Actor)currentAction.target).MissedMe();
                break;
            }

            case (RPGCalc.ChallangeResult.Success):     // hit
            {
                if (this.inventory.GetWpn() != null)
                {
                    RPGDamage dmg = new RPGDamage(this);
                    ((Actor)currentAction.target).DamageMe(dmg);
                }
                else
                {
                    // assume fists, and minimum damage (str bonus?)
                    ((Actor)currentAction.target).DamageMe(1);
                }
                break;
            }

            case (RPGCalc.ChallangeResult.Critical_Success):     // crit hit
            {
                if (this.inventory.GetWpn() != null)
                {
                    // crit = * 2
                    ((Actor)currentAction.target)
                    .DamageMe(new RPGCalc().RollDmg(this.inventory.GetWpn().minDmg,
                                                    this.inventory.GetWpn().maxDmg) * 2);
                }
                else
                {
                    // assume fists, and minimum damage (str bonus?)
                    ((Actor)currentAction.target).DamageMe(2);
                }
                break;
            }

            default:
            {
                break;
            }
            }
        }