rare_monsters #60
| @ -32,4 +32,8 @@ dat = "q233-ext-bb.dat" | ||||
| [[Retrieval.quests]] | ||||
| bin = "q236-ext-bb.bin" | ||||
| dat = "q236-ext-bb.dat" | ||||
| #drop_table = "q102-drops" | ||||
| #drop_table = "q102-drops" | ||||
| 
 | ||||
| [[Retrieval.quests]] | ||||
| bin = "q118-vr-bb.bin" | ||||
| dat = "q118-vr-bb.dat" | ||||
|  | ||||
| @ -108,12 +108,8 @@ impl RareMonsterAppearTable { | ||||
| 
 | ||||
|     pub fn roll_appearance(&self, monster: &MonsterType) -> bool { | ||||
|         println!("rolling appearance for {:?} with seed {:?}", monster, self.seed); | ||||
|         let mut rng = rand_chacha::ChaChaRng::from_entropy(); | ||||
|         let roll: f32 = rng.gen(); | ||||
|         let monster_rate = self.appear_rate.get(monster).unwrap_or(&0.0f32); | ||||
|         println!("rolled {:?} and {:?} has appear rate {:?}", roll, monster, monster_rate); | ||||
|         if roll < *monster_rate { | ||||
|         // if rng.gen::<f32>() < *self.appear_rate.get(monster).unwrap_or(&0.0f32) {
 | ||||
|         // let mut rng = rand_chacha::ChaChaRng::from_entropy();
 | ||||
|         if rand_chacha::ChaChaRng::from_entropy().gen::<f32>() < *self.appear_rate.get(monster).unwrap_or(&0.0f32) { | ||||
|             println!("its a rare!"); | ||||
|             true | ||||
|         } | ||||
|  | ||||
| @ -398,9 +398,10 @@ impl Maps { | ||||
|             }) | ||||
|     } | ||||
| 
 | ||||
|     pub fn set_quest_data(&mut self, enemies: Vec<Option<MapEnemy>>, objects: Vec<Option<MapObject>>) { | ||||
|     // pub fn set_quest_data(&mut self, enemies: Vec<Option<MapEnemy>>, objects: Vec<Option<MapObject>>, rare_monster_table: RareMonsterAppearTable) {
 | ||||
|     // pub fn set_quest_data(&mut self, enemies: Vec<Option<MapEnemy>>, objects: Vec<Option<MapObject>>) {
 | ||||
|     pub fn set_quest_data(&mut self, enemies: Vec<Option<MapEnemy>>, objects: Vec<Option<MapObject>>, rare_monster_appear_table: &RareMonsterAppearTable) { | ||||
|         self.enemy_data = enemies; | ||||
|         self.roll_monster_appearance(rare_monster_appear_table); | ||||
|         
 | ||||
|         // self.enemy_data = enemies
 | ||||
|         //                     .iter()
 | ||||
|  | ||||
| @ -83,7 +83,8 @@ pub fn player_chose_quest(id: ClientId, questmenuselect: &QuestMenuSelect, quest | ||||
|     let room = rooms.get_mut(room_id.0) | ||||
|         .ok_or_else(|| ShipError::InvalidRoom(room_id.0 as u32))?.as_mut() | ||||
|         .ok_or_else(|| ShipError::InvalidRoom(room_id.0 as u32))?; | ||||
|     room.maps.set_quest_data(quest.enemies.clone(), quest.objects.clone()); | ||||
|     // room.maps.set_quest_data(quest.enemies.clone(), quest.objects.clone());
 | ||||
|     room.maps.set_quest_data(quest.enemies.clone(), quest.objects.clone(), &room.rare_monster_table); | ||||
|     room.map_areas = quest.map_areas.clone(); | ||||
| 
 | ||||
|     let bin = quest::quest_header(questmenuselect, &quest.bin_blob, "bin"); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user