mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	ru:: icicles can now bounce to return to the top
This commit is contained in:
		| @@ -653,7 +653,7 @@ struct guineapig : public enemy { | |||||||
|   }; |   }; | ||||||
|  |  | ||||||
| struct icicle : public enemy { | struct icicle : public enemy { | ||||||
|   bool falling; |   int state; | ||||||
|   vector<xy> fallframes; |   vector<xy> fallframes; | ||||||
|   xy siz() override { return {10, 10}; } |   xy siz() override { return {10, 10}; } | ||||||
|   string glyph() override { return "|"; } |   string glyph() override { return "|"; } | ||||||
|   | |||||||
| @@ -802,19 +802,26 @@ void icicle::act() { | |||||||
|       } |       } | ||||||
|     regenerate(); |     regenerate(); | ||||||
|     } |     } | ||||||
|   if(!falling) { |   if(state == 0) { | ||||||
|     auto w = m.where; |     auto w = m.where; | ||||||
|     for(auto f: fallframes) { |     for(auto f: fallframes) { | ||||||
|       if(intersect(get_pixel_bbox_at(f), m.get_pixel_bbox_at(w))) falling = true; |       if(intersect(get_pixel_bbox_at(f), m.get_pixel_bbox_at(w))) state = 1; | ||||||
|       w += m.vel; |       w += m.vel; | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|   if(falling) { |   if(state == 1) { | ||||||
|     kino(); |     kino(); | ||||||
|     if(on_floor) existing = false; |     if(on_floor && vel.y > 0) existing = false; | ||||||
|  |     if(vel.y < 0) state = 2; | ||||||
|     } |     } | ||||||
|   if(intersect(get_pixel_bbox(), m.get_pixel_bbox())) { |   if(state == 2) { | ||||||
|     if(m.reduce_hp(50)) addMessage("An icicle falls on you!"); |     kino(); | ||||||
|  |     if(vel.y >= 0) state = 0; | ||||||
|  |     } | ||||||
|  |   if(state != 0) { | ||||||
|  |     if(intersect(get_pixel_bbox(), m.get_pixel_bbox())) { | ||||||
|  |       if(m.reduce_hp(50)) addMessage("An icicle falls on you!"); | ||||||
|  |       } | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue