change combat format
This commit is contained in:
parent
7d70a864fd
commit
6b2eda8391
@ -6,9 +6,14 @@ function CrypPanel({ battle }) {
|
|||||||
<div className="">
|
<div className="">
|
||||||
<div>{JSON.stringify(battle.a)}</div>
|
<div>{JSON.stringify(battle.a)}</div>
|
||||||
<div>{JSON.stringify(battle.b)}</div>
|
<div>{JSON.stringify(battle.b)}</div>
|
||||||
<ul>
|
<div>
|
||||||
{battle.log.map((l, i) => (<li key={i} >{l}</li>))}
|
{
|
||||||
</ul>
|
battle.log.map((l, i) => {
|
||||||
|
if (l === '') return (<br/>);
|
||||||
|
return <p key={i} >{l}</p>
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,6 +15,22 @@ const stringSort = (k, desc) => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const numSort = (k, desc) => {
|
||||||
|
if (desc) {
|
||||||
|
return (a, b) => {
|
||||||
|
if (!get(a, k)) return 1;
|
||||||
|
if (!get(b, k)) return -1;
|
||||||
|
return get(b, k) - get(a, k);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return (a, b) => {
|
||||||
|
if (!get(a, k)) return 1;
|
||||||
|
if (!get(b, k)) return -1;
|
||||||
|
return get(a, k) - get(b, k);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
stringSort,
|
stringSort,
|
||||||
|
numSort,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,34 +1,39 @@
|
|||||||
* Battling
|
* QOL
|
||||||
* QOL
|
|
||||||
* auto login
|
* auto login
|
||||||
* ws reconnect ✔️
|
* ws reconnect ✔
|
||||||
* Levelling
|
* Levelling ✔
|
||||||
* Global rolls
|
|
||||||
* Logins ✔️
|
* Global rolls
|
||||||
|
|
||||||
|
* Logins ✔️
|
||||||
* Cryp Ownership ✔
|
* Cryp Ownership ✔
|
||||||
* Matchmaking
|
|
||||||
|
* Matchmaking
|
||||||
* Lobbies
|
* Lobbies
|
||||||
* Create
|
* Create
|
||||||
* Join
|
* Join
|
||||||
* Resolve
|
* Resolve
|
||||||
* Stats
|
|
||||||
|
* Stats
|
||||||
* Scrabble grid
|
* Scrabble grid
|
||||||
* skills
|
|
||||||
|
* skills
|
||||||
* offensive -> choose target
|
* offensive -> choose target
|
||||||
* defensive
|
* defensive
|
||||||
* Items
|
|
||||||
|
* Items
|
||||||
* rez ✔
|
* rez ✔
|
||||||
* unselect item with esc + button
|
* unselect item with esc + button
|
||||||
* Grid reroll
|
* Grid reroll
|
||||||
* Colour scheme
|
* Colour scheme
|
||||||
* Missions
|
|
||||||
* Bosses
|
* Missions
|
||||||
|
|
||||||
|
* Bosses
|
||||||
|
|
||||||
* Cryp Generation
|
* Cryp Generation
|
||||||
*
|
*
|
||||||
|
|
||||||
* Blockchain Integration?
|
|
||||||
|
|
||||||
# Principles
|
# Principles
|
||||||
* Experience something
|
* Experience something
|
||||||
* Express something
|
* Express something
|
||||||
|
|||||||
@ -170,8 +170,15 @@ impl Cryp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn assign_dmg(&mut self, opp: &Cryp, plr_t: &mut Turn, opp_t: &Turn) -> &mut 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 final_dmg = opp_t.dmg.result.saturating_sub(plr_t.def.result);
|
||||||
let blocked = opp_t.dmg.result.saturating_sub(final_dmg);
|
// 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);
|
self.hp.reduce(final_dmg);
|
||||||
|
|
||||||
@ -182,6 +189,7 @@ impl Cryp {
|
|||||||
,blocked
|
,blocked
|
||||||
,self.hp.value));
|
,self.hp.value));
|
||||||
|
|
||||||
|
plr_t.log.push(format!(""));
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@ fn stoney(s: &Skill, mut roll: Roll) -> Roll {
|
|||||||
let effect = 0b11110000;
|
let effect = 0b11110000;
|
||||||
match roll.kind {
|
match roll.kind {
|
||||||
StatKind::Def => {
|
StatKind::Def => {
|
||||||
println!("{:064b} | <- {:?}", effect, s);
|
// println!("{:064b} | <- {:?}", effect, s);
|
||||||
roll.result = roll.result | effect;
|
roll.result = roll.result | effect;
|
||||||
roll
|
roll
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user