Compare commits
No commits in common. "5531e8aa7a7a5fbc7033318b3d76ec72dc720bcc" and "3bb1616d7e479d5218dd4a61eefe37d66fb751eb" have entirely different histories.
5531e8aa7a
...
3bb1616d7e
@ -63,6 +63,7 @@ pub fn process_part1(input: &str) -> i32 {
|
||||
|
||||
highest_happiness
|
||||
}
|
||||
|
||||
pub fn process_part2(input: &str) -> i32 {
|
||||
let mut happiness_table = HashMap::new();
|
||||
let mut people = Vec::new();
|
||||
|
@ -36,36 +36,6 @@ pub fn process_part1(input: &str) -> u32 {
|
||||
if leaf.state == State::Playing {
|
||||
//println!("try for leaf");
|
||||
for spell in Spell::get_all() {
|
||||
match spell.name {
|
||||
SpellID::MagicMissile | SpellID::Drain => {}
|
||||
SpellID::Shield => {
|
||||
if !leaf
|
||||
.player
|
||||
.status_effects
|
||||
.iter()
|
||||
.any(|effect| effect.name == SpellID::Shield && effect.duration > 1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
SpellID::Poison => {
|
||||
if !leaf
|
||||
.player
|
||||
.status_effects
|
||||
.iter()
|
||||
.any(|effect| effect.name == SpellID::Poison && effect.duration > 1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
SpellID::Recharge => {
|
||||
if !leaf.player.status_effects.iter().any(|effect| {
|
||||
effect.name == SpellID::Recharge && effect.duration > 1
|
||||
}) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
leafs.push(leaf.use_spell(spell));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user