|
@ -25,7 +25,7 @@ async fn test_character_gains_exp() { |
|
|
create_room(&mut ship, ClientId(1), "room", "").await;
|
|
|
create_room(&mut ship, ClientId(1), "room", "").await;
|
|
|
|
|
|
|
|
|
let (enemy_id, exp) = {
|
|
|
let (enemy_id, exp) = {
|
|
|
let room = ship.rooms[0].as_ref().unwrap();
|
|
|
|
|
|
|
|
|
let room = ship.blocks.0[0].rooms[0].as_ref().unwrap();
|
|
|
let (enemy_id, map_enemy) = (0..).filter_map(|i| {
|
|
|
let (enemy_id, map_enemy) = (0..).filter_map(|i| {
|
|
|
room.maps.enemy_by_id(i).map(|enemy| {
|
|
|
room.maps.enemy_by_id(i).map(|enemy| {
|
|
|
(i, enemy)
|
|
|
(i, enemy)
|
|
@ -64,7 +64,7 @@ async fn test_character_levels_up() { |
|
|
create_room(&mut ship, ClientId(1), "room", "").await;
|
|
|
create_room(&mut ship, ClientId(1), "room", "").await;
|
|
|
|
|
|
|
|
|
let enemy_id = {
|
|
|
let enemy_id = {
|
|
|
let room = ship.rooms[0].as_ref().unwrap();
|
|
|
|
|
|
|
|
|
let room = ship.blocks.0[0].rooms[0].as_ref().unwrap();
|
|
|
(0..).filter_map(|i| {
|
|
|
(0..).filter_map(|i| {
|
|
|
room.maps.enemy_by_id(i).map(|_| {
|
|
|
room.maps.enemy_by_id(i).map(|_| {
|
|
|
i
|
|
|
i
|
|
@ -102,7 +102,7 @@ async fn test_character_levels_up_multiple_times() { |
|
|
create_room(&mut ship, ClientId(1), "room", "").await;
|
|
|
create_room(&mut ship, ClientId(1), "room", "").await;
|
|
|
|
|
|
|
|
|
let (enemy_id, exp) = {
|
|
|
let (enemy_id, exp) = {
|
|
|
let room = ship.rooms[0].as_ref().unwrap();
|
|
|
|
|
|
|
|
|
let room = ship.blocks.0[0].rooms[0].as_ref().unwrap();
|
|
|
let (enemy_id, map_enemy) = (0..).filter_map(|i| {
|
|
|
let (enemy_id, map_enemy) = (0..).filter_map(|i| {
|
|
|
room.maps.enemy_by_id(i).ok().and_then(|enemy| {
|
|
|
room.maps.enemy_by_id(i).ok().and_then(|enemy| {
|
|
|
if enemy.monster == MonsterType::DarkFalz2 {
|
|
|
if enemy.monster == MonsterType::DarkFalz2 {
|
|
@ -152,7 +152,7 @@ async fn test_one_character_gets_full_exp_and_other_attacker_gets_partial() { |
|
|
join_room(&mut ship, ClientId(2), 0).await;
|
|
|
join_room(&mut ship, ClientId(2), 0).await;
|
|
|
|
|
|
|
|
|
let (enemy_id, exp) = {
|
|
|
let (enemy_id, exp) = {
|
|
|
let room = ship.rooms[0].as_ref().unwrap();
|
|
|
|
|
|
|
|
|
let room = ship.blocks.0[0].rooms[0].as_ref().unwrap();
|
|
|
let (enemy_id, map_enemy) = (0..).filter_map(|i| {
|
|
|
let (enemy_id, map_enemy) = (0..).filter_map(|i| {
|
|
|
room.maps.enemy_by_id(i).ok().and_then(|enemy| {
|
|
|
room.maps.enemy_by_id(i).ok().and_then(|enemy| {
|
|
|
if enemy.monster == MonsterType::DarkFalz2 {
|
|
|
if enemy.monster == MonsterType::DarkFalz2 {
|
|
|