disable flag for client side
This commit is contained in:
@@ -48,6 +48,8 @@ pub struct ConstructSkill {
|
||||
pub skill: Skill,
|
||||
pub self_targeting: bool,
|
||||
pub cd: Cooldown,
|
||||
// used for UI on client
|
||||
pub disabled: bool,
|
||||
}
|
||||
|
||||
impl ConstructSkill {
|
||||
@@ -56,6 +58,7 @@ impl ConstructSkill {
|
||||
skill,
|
||||
self_targeting: skill.self_targeting(),
|
||||
cd: skill.base_cd(),
|
||||
disabled: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -101,7 +104,7 @@ impl ConstructEffect {
|
||||
Some(EffectMeta::Multiplier(s)) => s,
|
||||
_ => 0
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+15
-2
@@ -168,8 +168,21 @@ impl Game {
|
||||
.expect("could not set phase end");
|
||||
|
||||
for player in self.players.iter_mut() {
|
||||
if player.skills_required() != 0 {
|
||||
player.set_ready(false);
|
||||
if player.skills_required() == 0 {
|
||||
continue;
|
||||
}
|
||||
|
||||
player.set_ready(false);
|
||||
|
||||
for construct in player.constructs.iter_mut() {
|
||||
for i in 0..construct.skills.len() {
|
||||
if let Some(d) = construct.disabled(construct.skills[i].skill) {
|
||||
info!("{:?} disabled {:?}", construct.skills[i].skill, d);
|
||||
construct.skills[i].disabled = true;
|
||||
} else {
|
||||
construct.skills[i].disabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user