From d10d53ee7d204d3cd7f5033b31b6837dcc5881b7 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 31 Mar 2026 15:50:52 +0200 Subject: [PATCH] ru:: axe now has special power --- rogueviz/ru/classes.cpp | 2 ++ rogueviz/ru/man.cpp | 8 ++++++++ rogueviz/ru/powers.cpp | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/rogueviz/ru/classes.cpp b/rogueviz/ru/classes.cpp index 84791cfe..f608a2c3 100644 --- a/rogueviz/ru/classes.cpp +++ b/rogueviz/ru/classes.cpp @@ -70,6 +70,7 @@ struct power { power& be_jewelry(string jtype, string desc); power& be_potion(); power& gain(int qf, int qo) { qty_filled += qf; qty_owned += qo; return self; } + power& add_flags(flagtype f) { flags |= f; return self; } void hs(struct stater& s); }; @@ -81,6 +82,7 @@ flagtype ACTIVE = Flag(2); flagtype PARTIAL = Flag(4); flagtype WEAPON = Flag(8); flagtype ARMOR = Flag(16); +flagtype WEAPON_AXE = Flag(32); struct bbox { int minx, miny, maxx, maxy; diff --git a/rogueviz/ru/man.cpp b/rogueviz/ru/man.cpp index 236165c8..6199e1bf 100644 --- a/rogueviz/ru/man.cpp +++ b/rogueviz/ru/man.cpp @@ -207,6 +207,14 @@ void man::launch_attack(power *p, int fac, boxfun f) { for(int y=bb.miny; yat(x, y); + if(b == wWeakWall && (p->flags & WEAPON_AXE)) { + current_room->replace_block_frev(x, y, wSmashedDoor); + addMessage("You smash the wall!"); + } + if(b == wDoor && (p->flags & WEAPON_AXE)) { + current_room->replace_block_frev(x, y, wSmashedDoor); + addMessage("You SMASH the door!"); + } if(b == wDoor) { current_room->replace_block_frev(x, y, wSmashedDoor); addMessage("You smash the door!"); diff --git a/rogueviz/ru/powers.cpp b/rogueviz/ru/powers.cpp index 2c14f07b..c6017903 100644 --- a/rogueviz/ru/powers.cpp +++ b/rogueviz/ru/powers.cpp @@ -459,7 +459,7 @@ void gen_powers() { if(d.keystate != 1) return; int fac = m.facing; m.launch_attack(d.p, fac, [fac] (int t) { return m.get_pixel_bbox_at(xy{m.where.x + fac * (1-0.01 * t) * m.dsiz().x, m.where.y}, 2, 2); }); - }).be_weapon(), + }).be_weapon().add_flags(WEAPON_AXE), gen_power('o', 0, "strange blue crystal ball", "You feel an urge to look into it.", "o", 0x00FF00FF,