void drop_weapon(Player *player) { if (CHANCE(10)) { Weapon w = weapon_create_rand(player->lvl); char c; printf("Vous trouvez une arme: "); weapon_display(w); printf("Voulez vous la prendre [o/n]? "); scanf("%c", &c); if (c == 'o') { player_setItem(player, I_WEAPON, &w); } } }
void drop_weapon(Player *player) { if (CHANCE(10)) { Weapon w = weapon_create_rand(player->lvl); char c; printf("\nVous trouvez une arme: "); weapon_display(w); printf("Voulez vous la prendre [o/n]? "); scanf("%c", &c); purge_stdin(); if (c == 'o') { ship_set_item(&player->ship, I_WEAPON, 0, &w); } } }
void commerce_display(Commerce *commerce) { for (int i = 0; i < MAX_WEAPON_ITEM; ++i) { if (commerce->weapon[i].isVisible) { weapon_display(commerce->weapon[i]); } } for (int i = 0; i < MAX_ARMOR_ITEM; ++i) { if (commerce->armor[i].isVisible) { armor_display(commerce->armor[i]); } } /* for (int i = 0; i < MAX_ENGINE_ITEM; ++i) { if (commerce->engine[i].isVisible) { armor_display(commerce->engine[i]); } }*/ for (int i = 0; i < MAX_HULL_ITEM; ++i) { if (commerce->hull[i].isVisible) { hull_display(commerce->hull[i]); } } }