Tile_coord adj = src.get_neighbor(dir%8);  int dx = adj.tx - src.tx, dy = adj.ty - src.ty; Tile_coord dest = src; dest.tx += 8*dx; dest.ty += 8*dy; gwin->add_effect(new Projectile_effect(src, dest, shapenum));
Projectile_effect *proj; if (dir < 8) { Tile_coord adj = src.get_neighbor(dir%8);  int dx = adj.tx - src.tx, dy = adj.ty - src.ty; Tile_coord dest = src; dest.tx += 12*dx; dest.ty += 12*dy; proj = new Projectile_effect(src, dest, shapenum); } else { Actor *party[9]; int cnt = gwin->get_party(party, 1); int n = rand()%cnt; proj = new Projectile_effect(src, party[n], shapenum); } gwin->add_effect(proj);
void Missile_launcher::handle_event	(	unsigned long curtime,	long udata	)	{	Game_window *gwin = Game_window::get_game_window();					// +++++Halt if egg off screen.	Tile_coord src = egg->get_abs_tile_coord();					// ++++Handle dir==8.					// Get adjacent tile in direction.	Tile_coord adj = src.get_neighbor(dir%8);					// Make it go 8 tiles.	int dx = adj.tx - src.tx, dy = adj.ty - src.ty;	Tile_coord dest = src;	dest.tx += 8*dx;	dest.ty += 8*dy;	gwin->add_effect(new Projectile_effect(src, dest, shapenum));					// Add back to queue for next time.	gwin->get_tqueue()->add(curtime + delay, this, udata);	}