1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-28 12:27:40 +00:00

ru:: the first monster, the boar

This commit is contained in:
Zeno Rogue
2025-04-27 12:42:22 +02:00
parent 1fb931836a
commit 77759538ae
8 changed files with 80 additions and 16 deletions

View File

@@ -64,7 +64,9 @@ vector<power> powers = {
[] (data& d) {
if(d.keystate != 1) return;
m.attack_facing = m.facing; m.attack_when = gframeid;
auto bb = pixel_to_block(m.get_pixel_bbox_at(m.where_x + m.attack_facing * m.dsx(), m.where_y));
auto pb = m.get_pixel_bbox_at(m.where_x + m.attack_facing * m.dsx(), m.where_y);
auto bb = pixel_to_block(pb);
for(auto& e: current_room->entities) if(intersect(e->get_pixel_bbox(), pb)) e->attacked(15);
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);