This commit is contained in:
ntr 2019-03-05 17:59:10 +11:00
parent 26250d5b74
commit 9e16201f3d
2 changed files with 23 additions and 18 deletions

View File

@ -10,6 +10,7 @@
# WORK WORK # WORK WORK
## NOW ## NOW
cost system for items cost system for items
be able to reclaim skills / specs from cryp
design / implement specs design / implement specs
combo specs combo specs
randomise skill speed randomise skill speed
@ -32,11 +33,6 @@ round system for games
* aoe skills * aoe skills
* combo skills * combo skills
* keep track of games joined
* concede game on leave
* ko all cryps on team, check status
should correctly assign the winner and drop items
* skills * skills
* private fields for opponents * private fields for opponents

View File

@ -123,7 +123,7 @@ enum ColourCode {
pub struct Vbox { pub struct Vbox {
pub id: Uuid, pub id: Uuid,
pub balance: u16, pub balance: u16,
pub free: Vec<Var>, pub free: Vec<Vec<Var>>,
pub bound: Vec<Var>, pub bound: Vec<Var>,
pub instance: Uuid, pub instance: Uuid,
pub account: Uuid, pub account: Uuid,
@ -131,17 +131,33 @@ pub struct Vbox {
impl Vbox { impl Vbox {
pub fn new(account_id: Uuid, instance_id: Uuid) -> Vbox { pub fn new(account_id: Uuid, instance_id: Uuid) -> Vbox {
Vbox { let starting_items = vec![
Var::Attack,
Var::Attack,
Var::Attack,
Var::Stam5,
Var::Stam5,
Var::Speed5,
Var::Speed5,
Var::Damage,
Var::Damage,
];
let vbox = Vbox {
id: Uuid::new_v4(), id: Uuid::new_v4(),
account: account_id, account: account_id,
instance: instance_id, instance: instance_id,
free: vec![], free: starting_items,
bound: vec![], bound: vec![],
balance: 0, balance: 9,
} };
vbox.fill();
return vbox;
} }
pub fn fill(&mut self, init: bool) -> &mut Vbox { pub fn fill(&mut self) -> &mut Vbox {
let colours = vec![ let colours = vec![
(Var::Red, 1), (Var::Red, 1),
(Var::Green, 1), (Var::Green, 1),
@ -177,13 +193,6 @@ impl Vbox {
free.push(vars[dist.sample(&mut rng)].0); free.push(vars[dist.sample(&mut rng)].0);
} }
// make sure there are 3 attacks in the first round
if init {
free[6] = Var::Attack;
free[7] = Var::Attack;
free[8] = Var::Attack;
}
self.free = free; self.free = free;
self self