change combat format
This commit is contained in:
+10
-2
@@ -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
@@ -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
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user