change combat format

This commit is contained in:
ntr
2018-10-17 16:57:57 +11:00
parent 7d70a864fd
commit 6b2eda8391
5 changed files with 67 additions and 33 deletions
+10 -2
View File
@@ -170,8 +170,15 @@ impl Cryp {
}
pub fn assign_dmg(&mut self, opp: &Cryp, plr_t: &mut Turn, opp_t: &Turn) -> &mut Cryp {
let final_dmg = opp_t.dmg.result.saturating_sub(plr_t.def.result);
let blocked = opp_t.dmg.result.saturating_sub(final_dmg);
// let final_dmg = opp_t.dmg.result.saturating_sub(plr_t.def.result);
// let blocked = opp_t.dmg.result.saturating_sub(final_dmg);
let final_dmg = opp_t.dmg.result & !plr_t.def.result;
let blocked = opp_t.dmg.result & plr_t.def.result;
plr_t.log.push(format!("{:064b} <- attacking roll {:?}", opp_t.dmg.result, opp_t.dmg.result));
// plr_t.log.push(format!("{:064b} <- blocking roll {:?}", plr_t.def.result, plr_t.def.result));
plr_t.log.push(format!("{:064b} <- final dmg {:?} ({:?} blocked)", final_dmg, final_dmg, blocked));
self.hp.reduce(final_dmg);
@@ -182,6 +189,7 @@ impl Cryp {
,blocked
,self.hp.value));
plr_t.log.push(format!(""));
self
}
+1 -1
View File
@@ -20,7 +20,7 @@ fn stoney(s: &Skill, mut roll: Roll) -> Roll {
let effect = 0b11110000;
match roll.kind {
StatKind::Def => {
println!("{:064b} | <- {:?}", effect, s);
// println!("{:064b} | <- {:?}", effect, s);
roll.result = roll.result | effect;
roll
},