add rez to plr pve
This commit is contained in:
parent
e99439002f
commit
08b830320a
@ -112,7 +112,12 @@ pub fn pve(params: CombatPveParams, db: &Db, account: &Account) -> Result<Battle
|
|||||||
|
|
||||||
// tells from_slice to cast into a cryp
|
// tells from_slice to cast into a cryp
|
||||||
let cryp_bytes: Vec<u8> = returned.get("data");
|
let cryp_bytes: Vec<u8> = returned.get("data");
|
||||||
let plr: Cryp = from_slice::<Cryp>(&cryp_bytes)?;
|
let mut plr: Cryp = from_slice::<Cryp>(&cryp_bytes)?;
|
||||||
|
|
||||||
|
// TEMP
|
||||||
|
if plr.hp.value == 0 {
|
||||||
|
plr.rez();
|
||||||
|
}
|
||||||
|
|
||||||
let mob = generate_mob(&plr);
|
let mob = generate_mob(&plr);
|
||||||
let mut battle = Battle::new(&plr, &mob);
|
let mut battle = Battle::new(&plr, &mob);
|
||||||
|
|||||||
@ -186,6 +186,11 @@ impl Cryp {
|
|||||||
self.hp.value == 0
|
self.hp.value == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn rez(&mut self) -> &mut Cryp {
|
||||||
|
self.hp.set(self.stam.value);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn spawn(params: CrypSpawnParams, db: &Db, account: &Account) -> Result<Cryp, Error> {
|
pub fn spawn(params: CrypSpawnParams, db: &Db, account: &Account) -> Result<Cryp, Error> {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user