mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2026-07-13 05:12:42 +00:00
ru:: hyperbouncy walls
This commit is contained in:
+15
-3
@@ -129,7 +129,11 @@ void entity::apply_walls() {
|
||||
if(walls[b].flags & W_DOWNWARD) continue;
|
||||
allside(x, y, b);
|
||||
if(walls[b].flags & blocking) {
|
||||
if(walls[b].flags & W_BOUNCY) { vel.y = -vel.y; apply_grav(); apply_grav(); if(vel.y > 0) vel.y = 0; on_bounce = true; goto again; }
|
||||
if(walls[b].flags & W_BOUNCY) {
|
||||
vel.y = -vel.y;
|
||||
if(walls[b].flags & W_HYPERBOUNCY) vel.y *= 10;
|
||||
apply_grav(); apply_grav(); if(vel.y > 0) vel.y = 0; on_bounce = true; goto again;
|
||||
}
|
||||
on_floor = true;
|
||||
if(walls[b].flags & W_FROZEN) on_ice = true;
|
||||
vel.y /= 2;
|
||||
@@ -157,7 +161,11 @@ void entity::apply_walls() {
|
||||
eWall b = current_room->at(x, y);
|
||||
allside(x, y, b);
|
||||
if(walls[b].flags & W_BLOCK) {
|
||||
if(walls[b].flags & W_BOUNCY) { vel.y = -vel.y; apply_grav(); apply_grav(); on_bounce = true; goto again; }
|
||||
if(walls[b].flags & W_BOUNCY) {
|
||||
vel.y = -vel.y;
|
||||
if(walls[b].flags & W_HYPERBOUNCY) vel.y *= 10;
|
||||
apply_grav(); apply_grav(); on_bounce = true; goto again;
|
||||
}
|
||||
vel.y /= 2;
|
||||
if(abs(vel.y) < 1e-6) vel.y = 0;
|
||||
if(pixel_to_block(get_pixel_bbox_at(where + vel)).miny > y) where.y += vel.y;
|
||||
@@ -182,7 +190,11 @@ void entity::apply_walls() {
|
||||
allside(x, y, b);
|
||||
if((walls[b].flags & W_DOWNWARD) && b == current_room->at(x-1, y)) continue;
|
||||
if(walls[b].flags & W_BLOCK) {
|
||||
if(walls[b].flags & W_BOUNCY) { vel.x = -vel.x; on_bounce = true; goto again; }
|
||||
if(walls[b].flags & W_BOUNCY) {
|
||||
vel.x = -vel.x;
|
||||
if(walls[b].flags & W_HYPERBOUNCY) vel.x *= 10;
|
||||
on_bounce = true; goto again;
|
||||
}
|
||||
if(freezing()) { hit_wall(); }
|
||||
if(burning()) {
|
||||
if(b == wWoodWall) current_room->replace_block_frev(x, y, wAir);
|
||||
|
||||
@@ -64,7 +64,7 @@ enum eWall {
|
||||
wSecretPassageHHidden, wSecretPassageH,
|
||||
wSign, wWallSign, wTimeDoor,
|
||||
wBottomSpike, wRogueWallHidden, wRogueWall, wRightSlope, wLeftSlope, wLeftSlopedRoof, wRightSlopedRoof,
|
||||
wWeakWall, wStrangeSign, wWalkSpikes, wGUARD };
|
||||
wWeakWall, wStrangeSign, wWalkSpikes, wHyperBouncy, wGUARD };
|
||||
|
||||
flagtype W_BLOCK = 1;
|
||||
flagtype W_TRANS = 2;
|
||||
@@ -133,6 +133,7 @@ ruwall walls[qwall] = {
|
||||
{"weak wall", "#", 0xC08080FF, W_BLOCK | W_STABLE, "These walls are quite weak, and can be destroyed with a weapon powerful enough, for example, an axe."},
|
||||
{"strange sign", "X", 0x90909080, W_TRANS, "A strange sign is drawn in the background."},
|
||||
{"walkable spikes", "|", 0xC08080FF, W_TRANS | W_PAIN_DOWN, "You can walk through these spikes, but falling into them would hurt."},
|
||||
{"hyper-bouncy wall", "#", 0xC04040FF, W_BLOCK | W_BOUNCY | W_HYPERBOUNCY, "Like walls, but things really bounce off them."},
|
||||
};
|
||||
|
||||
int sel = 1;
|
||||
|
||||
Reference in New Issue
Block a user