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()); } }
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(); } }
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); }
private void AttactLog(TextBox txtPlayerLog, BasePlayer player, AttactOTD attactValue, BaseWeapon weapon) { txtPlayerLog.Text += $"{player.Name}拿著{weapon.WeaponName}發動{attactValue.Attribute}攻擊造成傷害:{ attactValue.AttactValue}{Environment.NewLine}"; }