Merge branch 'construct-box-rework' into develop

This commit is contained in:
ntr
2019-11-24 23:41:08 +11:00
40 changed files with 1227 additions and 964 deletions
+4 -6
View File
@@ -323,8 +323,6 @@ impl Construct {
}
pub fn apply_modifiers(&mut self, player_colours: &Colours) -> &mut Construct {
self.specs.sort_unstable();
self.red_power.recalculate(&self.specs, player_colours);
self.red_life.recalculate(&self.specs, player_colours);
self.blue_power.recalculate(&self.specs, player_colours);
@@ -600,11 +598,11 @@ impl Construct {
self.reduce_green_life(red_remainder);
let red_damage_amount = red_current_green_life - self.green_life();
events.push(Event::Damage {
events.push(Event::Damage {
skill,
amount: red_damage_amount,
mitigation: red_mitigation,
colour: Colour::Red
colour: Colour::Red
});
}
@@ -629,11 +627,11 @@ impl Construct {
self.reduce_green_life(blue_remainder);
let blue_damage_amount = blue_current_green_life - self.green_life();
events.push(Event::Damage {
events.push(Event::Damage {
skill,
amount: blue_damage_amount,
mitigation: blue_mitigation,
colour: Colour::Blue
colour: Colour::Blue
});
}
}
+3 -3
View File
@@ -100,7 +100,7 @@ impl Vbox {
}
pub fn accept(&mut self, i: usize, j: usize, construct_id: Option<Uuid>) -> Result<&mut Vbox, Error> {
if self.bound.len() >= 9 && !construct_id.is_some() {
if self.bound.len() >= 6 && !construct_id.is_some() {
return Err(err_msg("too many items bound"));
}
@@ -150,7 +150,7 @@ impl Vbox {
for vi in vbox_indicies.iter() {
inv_indices.push(self.bound.len());
self.accept(vi[0], vi[1], Some(Uuid::nil()))?;
}
}
// have to sort the indices and keep track of the iteration
// because when removing the elements the array shifts
@@ -171,7 +171,7 @@ impl Vbox {
self.bound.push(combo.item);
// self.bound.sort_unstable();
if self.bound.len() >= 10 {
if self.bound.len() > 6 {
return Err(err_msg("too many items bound"));
}
Ok(self)