1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2024-11-22 05:33:02 +00:00

make curly's weapon respect light cone setting (fixes #109)

This commit is contained in:
Sallai József 2022-08-06 17:06:17 +03:00
parent b29c375a7a
commit f1542246c6

View file

@ -982,47 +982,51 @@ impl GameScene {
)
}
180 => {
// Curly's looking upward frames
let range = if [5, 6, 7, 8, 9].contains(&(npc.anim_num % 11)) {
60..120
} else if npc.action_num == 40 || npc.action_num == 41 {
0..0
} else if npc.direction() == Direction::Left {
-30..30
} else if npc.direction() == Direction::Right {
150..210
} else {
0..0
};
if state.settings.light_cone {
// Curly's looking upward frames
let range = if [5, 6, 7, 8, 9].contains(&(npc.anim_num % 11)) {
60..120
} else if npc.action_num == 40 || npc.action_num == 41 {
0..0
} else if npc.direction() == Direction::Left {
-30..30
} else if npc.direction() == Direction::Right {
150..210
} else {
0..0
};
self.draw_light_raycast(
state.tile_size,
npc.x + npc.direction.opposite().vector_x() * 0x800,
npc.y + 2 * 0x200,
(19u8, 34u8, 117u8),
0.95,
range,
batch,
);
self.draw_light_raycast(
state.tile_size,
npc.x + npc.direction.opposite().vector_x() * 0x800,
npc.y + 2 * 0x200,
(19u8, 34u8, 117u8),
0.95,
range,
batch,
);
}
}
320 => {
let range = match npc.direction() {
Direction::Up => 60..120,
Direction::Bottom => 240..300,
Direction::Left => -30..30,
Direction::Right => 150..210,
_ => 0..0,
};
if state.settings.light_cone {
let range = match npc.direction() {
Direction::Up => 60..120,
Direction::Bottom => 240..300,
Direction::Left => -30..30,
Direction::Right => 150..210,
_ => 0..0,
};
self.draw_light_raycast(
state.tile_size,
npc.x + npc.direction.opposite().vector_x() * 0x800,
npc.y + 2 * 0x200,
(19u8, 34u8, 117u8),
0.95,
range,
batch,
);
self.draw_light_raycast(
state.tile_size,
npc.x + npc.direction.opposite().vector_x() * 0x800,
npc.y + 2 * 0x200,
(19u8, 34u8, 117u8),
0.95,
range,
batch,
);
}
}
322 => {
let scale = 0.004 * (npc.action_counter as f32);