1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-04-15 14:31:23 +00:00

ru:: axe now has special power

This commit is contained in:
Zeno Rogue
2026-03-31 15:50:52 +02:00
parent 8d3717e0f2
commit d10d53ee7d
3 changed files with 11 additions and 1 deletions

View File

@@ -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;

View File

@@ -207,6 +207,14 @@ void man::launch_attack(power *p, int fac, boxfun f) {
for(int y=bb.miny; y<bb.maxy; y++)
for(int x=bb.minx; x<bb.maxx; x++) {
int b = current_room->at(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!");

View File

@@ -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,