예제 #1
0
 private AttactOTD GetAttactOTDWithWeapon()
 {
     if (this.Weapon == null)
     {
         var attactOtd = new AttactOTD();
         attactOtd.AttactValue = Power;
         attactOtd.Attribute   = AttactAttribute.無;
         attactOtd.IsLunch     = false;
         return(attactOtd);
     }
     else
     {
         return(GetAtttributeWeaponAttactOTD());
     }
 }
예제 #2
0
        public void 遭受攻擊(AttactOTD attact)
        {
            if (this is IDefense)
            {
                this.Hp -= attact.AttactValue - (this as IDefense).DefenseValue;
            }
            else
            {
                this.Hp -= attact.AttactValue;
            }

            if (this.Hp <= 0)
            {
                WenDead();
            }
        }
예제 #3
0
        private AttactOTD GetAtttributeWeaponAttactOTD()
        {
            var attactOtd = new AttactOTD();

            attactOtd.AttactValue = Power + this.Weapon.RandomAttactValue();
            var AtttributeWeapon = this.Weapon as ISetWeaponAttribute;

            if (AtttributeWeapon != null)
            {
                attactOtd.Attribute = AtttributeWeapon.HasAttribute
                    ? AtttributeWeapon.WeaponAttribute.Attribute : AttactAttribute.無;
            }
            else
            {
                attactOtd.Attribute = AttactAttribute.無;
            }
            attactOtd.IsLunch = true;

            return(attactOtd);
        }
예제 #4
0
 private void AttactLog(TextBox txtPlayerLog, BasePlayer player, AttactOTD attactValue, BaseWeapon weapon)
 {
     txtPlayerLog.Text += $"{player.Name}拿著{weapon.WeaponName}發動{attactValue.Attribute}攻擊造成傷害:{ attactValue.AttactValue}{Environment.NewLine}";
 }