Name the difficulty id field as #2239 does

#2239 adds the same LocalDifficulty field as `id`; with the same lines
here the two branches merge without a conflict.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-27 07:03:08 +01:00
parent d136dda092
commit e42a82e9b9
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -324,7 +324,7 @@ pub fn sting(m: &mut Mob, who: Who, cx: &mut Cx) {
Who::Player => {
cx.events.push(MobEvent::AttackPlayer(amount, from));
// Poison only on normal (10 s) and hard (18 s).
let seconds = match cx.w.difficulty.base {
let seconds = match cx.w.difficulty.id {
2 => 10,
3 => 18,
_ => 0,
+4 -4
View File
@@ -37,8 +37,8 @@ pub struct LocalDifficulty {
pub effective: f32,
/// The world difficulty is hard.
pub hard: bool,
/// The world difficulty id, 0 peaceful to 3 hard.
pub base: u8,
/// `Difficulty.getId`: 0 peaceful to 3 hard.
pub id: u8,
}
/// `DimensionType.MOON_BRIGHTNESS_PER_PHASE`.
pub const MOON_BRIGHTNESS: [f32; 8] = [1.0, 0.75, 0.5, 0.25, 0.0, 0.25, 0.5, 0.75];
@@ -51,7 +51,7 @@ impl LocalDifficulty {
return Self {
effective: 0.0,
hard,
base,
id: base,
};
}
let global = ((total as f32 - 72000.0) / 1_440_000.0).clamp(0.0, 1.0) * 0.25;
@@ -64,7 +64,7 @@ impl LocalDifficulty {
Self {
effective: f32::from(base) * (0.75 + global + local),
hard,
base,
id: base,
}
}
/// `getSpecialMultiplier`.