|
@ -33,8 +33,7 @@ fn parse_enemy(episode: &Episode, map_area: &MapArea, raw_enemy: RawMapEnemy) -> |
|
|
|
|
|
|
|
|
enemy
|
|
|
enemy
|
|
|
.map_or(vec![None], |monster| {
|
|
|
.map_or(vec![None], |monster| {
|
|
|
let mut monsters = Vec::new();
|
|
|
|
|
|
monsters.push(Some(monster));
|
|
|
|
|
|
|
|
|
let mut monsters = vec![Some(monster)];
|
|
|
|
|
|
|
|
|
match monster.monster {
|
|
|
match monster.monster {
|
|
|
MonsterType::Monest => {
|
|
|
MonsterType::Monest => {
|
|
@ -333,9 +332,9 @@ impl Maps { |
|
|
}
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
.collect();
|
|
|
.collect();
|
|
|
for i in 0..shiny.len() {
|
|
|
|
|
|
|
|
|
for monster in &shiny {
|
|
|
if let Some(j) = rare_monsters.iter().position(|&x| x == 0xFFFF) {
|
|
|
if let Some(j) = rare_monsters.iter().position(|&x| x == 0xFFFF) {
|
|
|
rare_monsters[j] = shiny[i].0 as u16;
|
|
|
|
|
|
|
|
|
rare_monsters[j] = monster.0 as u16;
|
|
|
} else {
|
|
|
} else {
|
|
|
break
|
|
|
break
|
|
|
}
|
|
|
}
|
|
@ -346,11 +345,18 @@ impl Maps { |
|
|
pub fn roll_monster_appearance(&mut self, rare_monster_table: &RareMonsterAppearTable) {
|
|
|
pub fn roll_monster_appearance(&mut self, rare_monster_table: &RareMonsterAppearTable) {
|
|
|
self.enemy_data = self.enemy_data
|
|
|
self.enemy_data = self.enemy_data
|
|
|
.iter()
|
|
|
.iter()
|
|
|
.map(|&x| if x.is_some() && x.unwrap().has_rare_appearance() {
|
|
|
|
|
|
Some(x.unwrap().roll_appearance_for_mission(&rare_monster_table))
|
|
|
|
|
|
} else {
|
|
|
|
|
|
x
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
// .map(|&x| if x.is_some() && x.unwrap().has_rare_appearance() {
|
|
|
|
|
|
.map(|&x|
|
|
|
|
|
|
if let Some(monster) = x {
|
|
|
|
|
|
if monster.has_rare_appearance() {
|
|
|
|
|
|
Some(monster.roll_appearance_for_mission(rare_monster_table))
|
|
|
|
|
|
} else {
|
|
|
|
|
|
Some(monster)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
x
|
|
|
|
|
|
}
|
|
|
|
|
|
)
|
|
|
.collect();
|
|
|
.collect();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|