Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions integration-harness/tests/beginner_skills.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
//! through CLOSE_RANGE_ATTACK, and Recovery and Nimble Feet are buffs from
//! USE_SKILL. Each spends its MP, and the map sees it used.

use integration_harness::hunting::{attack, cancel_buff, skill_attack, spend_sp, use_skill};
use integration_harness::hunting::{
attack, cancel_buff, magic_attack, skill_attack, spend_sp, use_skill,
};
use integration_harness::preconditions::load_harness_config_or_fail;
use integration_harness::trace::{barrier, read_for, send, stat, until, warp, Trace};
use integration_harness::{login_to_world_session, WorldSession};
Expand Down Expand Up @@ -75,7 +77,10 @@ async fn beginner_skills_spend_mp_and_take_effect() {
// Three Snails at level 1 does exactly 10, for 3 of a new beginner's 5 MP.
until(&mut a.connection, ta, |t| !t.field.alive(SNAIL).is_empty()).await;
let target = ta.field.alive(SNAIL)[0];
send(&mut a.connection, skill_attack(THREE_SNAILS, target, 11)).await;
// v83 casts Three Snails (MAGIC_ATTACK), and a spell past its cap is
// refused outright; a physical one could be on a mob iced by Combo
// Tempest, which only the field knows (P234).
send(&mut a.connection, magic_attack(THREE_SNAILS, target, 11)).await;
send(&mut a.connection, skill_attack(RECOVERY, target, 1)).await;
barrier(&mut a.connection, "refused", ta).await;
// Still the 5 MP from the level-up update.
Expand Down
24 changes: 20 additions & 4 deletions integration-harness/tests/ferries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ use tokio::time::Duration;

const LITH_HARBOR: i32 = 104_000_000;
const RIEN_DOCK: i32 = 140_020_300;
/// The town Puro's choice names (the dock is "Dangerous Forest").
const RIEN: i32 = 140_000_000;
const LITH_TO_RIEN: i32 = 200_090_060;
const RIEN_TO_LITH: i32 = 200_090_070;
const ORBIS_FERRY_PLATFORM: i32 = 200_000_161;
Expand Down Expand Up @@ -97,13 +99,27 @@ async fn puro_ferries_a_player_to_rien_and_back_on_a_countdown() {
let mut session = traveller(&config, 1600, LITH_HARBOR).await;
let m = session.character_name.clone();
let c = &mut session.connection;
for (from, puro, ride, to, meso) in [
(LITH_HARBOR, PURO_IN_LITH, LITH_TO_RIEN, RIEN_DOCK, 800),
(RIEN_DOCK, PURO_IN_RIEN, RIEN_TO_LITH, LITH_HARBOR, 0),
for (from, puro, ride, to, town, meso) in [
(
LITH_HARBOR,
PURO_IN_LITH,
LITH_TO_RIEN,
RIEN_DOCK,
RIEN,
800,
),
(
RIEN_DOCK,
PURO_IN_RIEN,
RIEN_TO_LITH,
LITH_HARBOR,
LITH_HARBOR,
0,
),
] {
let t = step(c, &format!("{m} talk"), talk(from, puro)).await;
assert_eq!(t.prompts, [(puro, 4)]);
assert!(t.prompt_texts[0].contains(&format!("#m{to}#")));
assert!(t.prompt_texts[0].contains(&format!("#m{town}#")));
let t = step(c, &format!("{m} pick"), answer(4, 1, Some(0))).await;
assert_eq!(t.prompts, [(puro, 1)]);
let mut t = step(c, &format!("{m} yes"), answer(1, 1, None)).await;
Expand Down
6 changes: 5 additions & 1 deletion integration-harness/tests/monster_book.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ async fn snail_cards_fill_the_book_and_persist_with_the_cover() {
pickup(card.object_id, card.x, card.y),
)
.await;
until(&mut hunter.connection, &mut h, |t| t.cards.len() > kill).await;
// The card goes in first; the map hears it taken after (P259).
until(&mut hunter.connection, &mut h, |t| {
t.cards.len() > kill && !t.field.removals(card.object_id).is_empty()
})
.await;
assert_eq!(
h.field.removals(card.object_id),
[Some(hunter.character_id)]
Expand Down
8 changes: 6 additions & 2 deletions integration-harness/tests/snipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ async fn snipe_hits_hard_and_cools_down() {
until(c, &mut h, |t| t.field.alive(SNAIL).len() >= 2).await;
let snails = h.field.alive(SNAIL);

// More than 199,999 is refused.
// More than 199,999 is refused. A shot past every cap could be on a mob
// iced by Combo Tempest, which only the field knows, so it's spent
// (and cools down) before the field refuses it (P234).
send(c, ranged_attack(SNIPE, QUIVER, snails[0], 200_000)).await;
until(c, &mut h, |t| t.cooldowns.contains(&(SNIPE, 4))).await;
read_for(c, &mut h, 400).await;
assert!(!h.field.killed.contains(&snails[0]));
assert!(h.cooldowns.is_empty());
until(c, &mut h, |t| t.cooldowns.contains(&(SNIPE, 0))).await;
h.cooldowns.clear();

// 199,999 kills, and the client hears of the cooltime.
send(c, ranged_attack(SNIPE, QUIVER, snails[0], 199_999)).await;
Expand Down
Loading