Beispiel #1
0
void		gfx_player_begin_incantation(t_ctrl *c, t_player *p)
{
  t_jm_list	*l;
   int		*ids;

  if ((ids = calloc(get_nb_players(c, p->x, p->y, p->lvl) + 1, sizeof(*ids))))
    {
      _fill_ids(c, p, ids);
      l = c->l;
      while (l)
	{
	  if (l->fd != -1 && l->data && ((t_handler *)l->data)->t == GFX)
	    plc(l, p, ids);
	  l = l->next;
	}
      free(ids);
    }
}
Beispiel #2
0
int main() {
    int nb_players, i;
    char **names = NULL;

    init();

    nb_players = get_nb_players();

    names = malloc(sizeof(char *) * nb_players);
    for (i=0; i<nb_players; i++)
        names[i] = malloc(sizeof(char) * 8);

    get_players_name(nb_players, names);

    main_game(nb_players, names);

    return 0;
}
Beispiel #3
0
int	can_elevate(t_ctrl *c, t_player *p)
{
    int	idx;

    idx = p->lvl;
    if (idx >= 8)
        return (0);
    if (get_nb_object(c, p->x, p->y, LINEMATE) != gl_inc[idx].linemate ||
            get_nb_object(c, p->x, p->y, DERAUMERE) != gl_inc[idx].deraumere ||
            get_nb_object(c, p->x, p->y, SIBUR) != gl_inc[idx].sibur ||
            get_nb_object(c, p->x, p->y, MENDIANE) != gl_inc[idx].mendiane ||
            get_nb_object(c, p->x, p->y, PHIRAS) != gl_inc[idx].phiras ||
            get_nb_object(c, p->x, p->y, THYSTAME) != gl_inc[idx].thystame)
        return (0);
    if (get_nb_object(c, p->x, p->y, PLAYER) != gl_inc[idx].players)
        return (0);
    if (get_nb_players(c, p->x, p->y, p->lvl) != gl_inc[idx].players)
        return (0);
    return (1);
}