void identify(int blessing) { int index; clearmsg(); if (blessing == 0) { index = getitem_prompt("Identify: ", NULL_ITEM); if (index == CASHVALUE) print3("Your money is really money."); else if (index == ABORT) State.setSkipMonsters(); else { if (Player.possessions[index]->objchar == FOOD) Player.possessions[index]->known = 1; else { Player.possessions[index]->known = 2; Objects[Player.possessions[index]->id].known = 1; } print1("Identified: "); mprint(itemid(Player.possessions[index])); } } else if (blessing < 0) { print2("You feel forgetful."); for (index=0; index<MAXITEMS; index++) if (Player.possessions[index] != NULL) { Player.possessions[index]->known = 0; Objects[Player.possessions[index]->id].known = 0; } } else { print2("You feel encyclopaedic."); for (index=0; index<MAXITEMS; index++) if (Player.possessions[index] != NULL) { if (Player.possessions[index]->objchar == FOOD) Player.possessions[index]->known = 1; else { Player.possessions[index]->known = 2; Objects[Player.possessions[index]->id].known = 1; } } for (index=0; index<Player.packptr; index++) if (Player.pack[index] != NULL) { if (Player.pack[index]->objchar == FOOD) Player.pack[index]->known = 1; else { Player.pack[index]->known = 2; Objects[Player.pack[index]->id].known = 1; } } } calc_melee(); }
void i_charge(pob o) { int i; if (o->blessing > -1) Objects[o->id].known = 1; i = getitem_prompt("A scroll of charging. Charge: ", STICK); if (i != ABORT) { if (o->blessing < 0) { mprint("The stick glows black!"); Player.possessions[i]->charge = 0; } else { mprint("The stick glows blue!"); Player.possessions[i]->charge += (random_range(10)+1)*(o->blessing+1); if (Player.possessions[i]->charge > 99) Player.possessions[i]->charge = 99; } } }