Raise walls: plan them on own floor, imps build reinforced earth
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
398bb95681
commit
ed3bc437e5
26 files changed
+347
-11
No files matched your search
+23
-2
@@ -41,6 +41,7 @@ mod spells;
|
||||
mod touch;
|
||||
mod ui;
|
||||
mod voice;
|
||||
mod walls;
|
||||
mod wilds;
|
||||
mod wood;
|
||||
mod xm;
|
||||
@@ -108,7 +109,7 @@ fn tool_tile(cam: &Cam, map: &map::Map, tool: Tool, mx: f32, my: f32) -> Option<
|
||||
}
|
||||
|
||||
fn area_tool(t: Tool) -> bool {
|
||||
matches!(t, Tool::Dig | Tool::Room(_) | Tool::Sell | Tool::Bridge | Tool::Steel | Tool::Drawbridge)
|
||||
matches!(t, Tool::Dig | Tool::Room(_) | Tool::Sell | Tool::Bridge | Tool::Steel | Tool::Drawbridge | Tool::Wall)
|
||||
}
|
||||
|
||||
// Use the active tool on the world at (mx, my) (CSS pixels): a click, or a tap on touch screens
|
||||
@@ -121,7 +122,7 @@ fn world_action(app: &mut App, ui: &mut Ui, r3d: &R3d, inp: &mut Input, mx: f32,
|
||||
let ground = app.cam.ground_point(mx, my);
|
||||
let (wx, wy) = (ground.x, ground.y);
|
||||
match (ui.tool, tile) {
|
||||
(Tool::Dig | Tool::Room(_) | Tool::Sell | Tool::Bridge | Tool::Steel | Tool::Drawbridge, Some(t)) => inp.ldown = Some(t),
|
||||
(Tool::Dig | Tool::Room(_) | Tool::Sell | Tool::Bridge | Tool::Steel | Tool::Drawbridge | Tool::Wall, Some(t)) => inp.ldown = Some(t),
|
||||
(Tool::Hand, _) => {
|
||||
let j = r3d.pick_ent(&app.game, &app.cam, mx, my, false);
|
||||
let Some(j) = j else { return };
|
||||
@@ -165,6 +166,7 @@ fn finish_rect(app: &mut App, tool: Tool, start: (i32, i32), mx: f32, my: f32) {
|
||||
Tool::Sell => app.game.queue(Act::Sell(r)),
|
||||
Tool::Bridge => app.game.queue(Act::Bridge(r)),
|
||||
Tool::Drawbridge => app.game.queue(Act::Drawbridge(r)),
|
||||
Tool::Wall => app.game.queue(Act::Wall(r)),
|
||||
Tool::Steel => app.game.queue(Act::Steel(r)),
|
||||
_ => {}
|
||||
}
|
||||
@@ -1949,6 +1951,7 @@ fn draw_frame(app: &mut App, gfx: &Gfx, r3d: &mut R3d, ui: &mut Ui, menu: &mut M
|
||||
Tool::Heal => (Color::new(0.4, 1.0, 0.5, 1.0), Some((ground.x, ground.y, 2.55))),
|
||||
Tool::Summon => (Color::new(0.8, 0.5, 1.0, 1.0), None),
|
||||
Tool::Bridge | Tool::Drawbridge => (Color::new(0.9, 0.7, 0.4, 1.0), None),
|
||||
Tool::Wall => (Color::new(0.8, 0.4, 1.0, 1.0), None),
|
||||
Tool::Steel => (Color::new(0.75, 0.8, 0.9, 1.0), None),
|
||||
Tool::Tower(_) => (Color::new(1.0, 0.6, 0.25, 1.0), None),
|
||||
Tool::Trap(_) => (Color::new(1.0, 0.4, 0.3, 1.0), None),
|
||||
@@ -1966,6 +1969,24 @@ fn draw_frame(app: &mut App, gfx: &Gfx, r3d: &mut R3d, ui: &mut Ui, menu: &mut M
|
||||
if app.settings.debug_trigger_zones || app.settings.debug_path_lines || app.editor_testing {
|
||||
draw_debug_3d(app, now);
|
||||
}
|
||||
// planned walls of this master: a pulsing frame where the wall will rise
|
||||
let pulse = 0.55 + 0.25 * ((now * 3.0).sin() as f32);
|
||||
let me = app.game.local_side;
|
||||
for &(i, side) in app.game.wall_plans.iter().filter(|p| p.1 == me).take(200) {
|
||||
let (x, z) = map::xy(i);
|
||||
let (x0, z0, x1, z1) = (x as f32 + 0.08, z as f32 + 0.08, x as f32 + 0.92, z as f32 + 0.92);
|
||||
let c = Color::new(0.75, 0.45, 1.0, pulse);
|
||||
let _ = side;
|
||||
for h in [0.02, 0.9] {
|
||||
line3(vec3(x0, h, z0), vec3(x1, h, z0), 0.04, c);
|
||||
line3(vec3(x1, h, z0), vec3(x1, h, z1), 0.04, c);
|
||||
line3(vec3(x1, h, z1), vec3(x0, h, z1), 0.04, c);
|
||||
line3(vec3(x0, h, z1), vec3(x0, h, z0), 0.04, c);
|
||||
}
|
||||
for (a, b) in [(x0, z0), (x1, z0), (x1, z1), (x0, z1)] {
|
||||
line3(vec3(a, 0.02, b), vec3(a, 0.9, b), 0.04, c);
|
||||
}
|
||||
}
|
||||
let title_screen = matches!(
|
||||
menu.page,
|
||||
Some(Page::Title)
|
||||
|
||||
Reference in new issue
Block a user