rework: A5 no-hit-seed rationale comment + spell-level range via use import (WI-2 2B findings, issue #2)
This commit is contained in:
parent
f0659421e7
commit
c613142bd4
2 changed files with 5 additions and 3 deletions
|
|
@ -5,6 +5,7 @@ use axum::extract::{Path, Query, State};
|
|||
use axum::routing::{get, post};
|
||||
use axum::{Extension, Json, Router};
|
||||
use sb_core::character::{self, CLASSES, GYM_STAT_DISPLAY_ORDER, RACES, TRAINING_GROUNDS};
|
||||
use sb_core::constants::{MAX_SPELL_LEVEL, MIN_SPELL_LEVEL};
|
||||
use sb_core::data;
|
||||
use sb_core::items;
|
||||
use sb_core::services as domain;
|
||||
|
|
@ -1141,9 +1142,7 @@ async fn learn_spell_level(
|
|||
return Err(axum::http::StatusCode::FORBIDDEN);
|
||||
}
|
||||
|
||||
if !(sb_core::constants::MIN_SPELL_LEVEL..=sb_core::constants::MAX_SPELL_LEVEL)
|
||||
.contains(&spell_level)
|
||||
{
|
||||
if !(MIN_SPELL_LEVEL..=MAX_SPELL_LEVEL).contains(&spell_level) {
|
||||
return Err(axum::http::StatusCode::BAD_REQUEST);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -374,6 +374,9 @@ mod tests {
|
|||
let now_ms = 10 * constants::HP_REGEN_INTERVAL_MS;
|
||||
let mut enemy = weak_enemy();
|
||||
enemy.damage = 0;
|
||||
// Seed 42 was verified at fixture-recording time to yield zero enemy
|
||||
// hits (the character kills the damaged-0 enemy in round 1), so the
|
||||
// hp == 80 assertion holds: design §7 A5 no-hit-seed rationale.
|
||||
let outcome = run_adventure(&mut rng, &mut c, &zone(), &[enemy], &items(), now_ms).unwrap();
|
||||
|
||||
assert_eq!(c.last_regen, now_ms);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue