Lines Matching refs:otmp

101 /* bhitm: monster mtmp was hit by the effect of wand or spell otmp */
103 bhitm(mtmp, otmp)
105 struct obj *otmp;
110 int dmg, otyp = otmp->otyp;
134 (void) resist(mtmp, otmp->oclass, dmg, TELL);
140 if (!resist(mtmp, otmp->oclass, 0, NOTELL)) {
141 mon_adjust_speed(mtmp, -1, otmp);
152 if (!resist(mtmp, otmp->oclass, 0, NOTELL)) {
153 mon_adjust_speed(mtmp, 1, otmp);
169 if (!resist(mtmp, otmp->oclass, dmg, NOTELL)) {
181 } else if (!resist(mtmp, otmp->oclass, 0, NOTELL)) {
205 (void) cancel_monst(mtmp, otmp, TRUE, TRUE, FALSE);
286 (void) resist(mtmp, otmp->oclass,
291 if (flash_hits_mon(mtmp, otmp)) {
300 if (sleep_monst(mtmp, d(1 + otmp->spe, 12), WAND_CLASS))
326 else if (!resist(mtmp, otmp->oclass, dmg, NOTELL) &&
367 struct obj *otmp;
377 for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj)
378 otmp->dknown = 1; /* treat as "seen" */
740 struct obj *otmp, *otmp2;
749 while ((otmp = otmp2) != 0) {
750 otmp2 = otmp->nobj;
751 if (otmp->otyp == EGG)
752 revive_egg(otmp);
753 if (otmp->otyp != CORPSE) continue;
755 if (youseeit) Strcpy(corpse, corpse_xname(otmp, TRUE));
758 if ((mtmp2 = revive(otmp)) != 0) {
1033 register struct obj *otmp, *otmp2;
1035 for(otmp = objhdr; minwt > 0 && otmp; otmp = otmp2) {
1036 otmp2 = otmp->nexthere;
1037 if (otmp == uball || otmp == uchain) continue;
1038 if (obj_resists(otmp, 0, 0)) continue; /* preserve unique objects */
1040 if (otmp->otyp == SCR_MAIL) continue;
1043 if (((int) objects[otmp->otyp].oc_material == mat) ==
1046 if (costly_spot(otmp->ox, otmp->oy)) {
1048 addtobill(otmp, FALSE, FALSE, FALSE);
1050 (void)stolen_value(otmp,
1051 otmp->ox, otmp->oy, FALSE, FALSE);
1053 if (otmp->quan < LARGEST_INT)
1054 minwt -= (int)otmp->quan;
1057 delobj(otmp);
1206 struct obj *otmp;
1217 otmp = (struct obj *)0;
1219 if (otmp) delobj(otmp);
1220 otmp = mkobj(obj->oclass, FALSE);
1222 objects[obj->otyp].oc_magic != objects[otmp->otyp].oc_magic);
1225 otmp = mksobj(id, FALSE, FALSE);
1229 otmp->corpsenm = obj->corpsenm;
1234 otmp->quan = obj->quan;
1236 otmp->no_charge = obj->no_charge;
1239 otmp->invlet = obj->invlet;
1245 otmp->otyp = SCR_MAIL;
1246 otmp->spe = 1;
1255 if (otmp->otyp == EGG)
1256 kill_egg(otmp);
1258 otmp->otyp = EGG;
1259 otmp->owt = weight(otmp);
1261 otmp->corpsenm = NON_PM;
1262 otmp->spe = 0;
1268 otmp->spe = 1; /* layed by hero */
1269 otmp->corpsenm = mnum;
1270 attach_egg_hatch_timeout(otmp);
1277 if (index(charged_objs, otmp->oclass)) otmp->spe = obj->spe;
1278 otmp->recharged = obj->recharged;
1280 otmp->cursed = obj->cursed;
1281 otmp->blessed = obj->blessed;
1282 otmp->oeroded = obj->oeroded;
1283 otmp->oeroded2 = obj->oeroded2;
1284 if (!is_flammable(otmp) && !is_rustprone(otmp)) otmp->oeroded = 0;
1285 if (!is_corrodeable(otmp) && !is_rottable(otmp)) otmp->oeroded2 = 0;
1286 if (is_damageable(otmp))
1287 otmp->oerodeproof = obj->oerodeproof;
1290 if (obj->otrapped && Is_box(otmp)) otmp->otrapped = TRUE;
1292 if (obj->opoisoned && is_poisonable(otmp))
1293 otmp->opoisoned = TRUE;
1298 otmp->otyp = LOW_BOOTS;
1299 otmp->oclass = ARMOR_CLASS;
1300 otmp->spe = 0;
1301 otmp->oeroded = 0;
1302 otmp->oerodeproof = TRUE;
1303 otmp->quan = 1L;
1304 otmp->cursed = FALSE;
1309 if (Has_contents(otmp)) delete_contents(otmp);
1312 if (otmp->quan > 1L && (!objects[otmp->otyp].oc_merge ||
1313 (can_merge && otmp->quan > (long)rn2(1000))))
1314 otmp->quan = 1L;
1316 switch (otmp->oclass) {
1319 if (otmp->otyp == MAGIC_LAMP) {
1320 otmp->otyp = OIL_LAMP;
1321 otmp->age = 1500L; /* "best" oil lamp possible */
1322 } else if (otmp->otyp == MAGIC_MARKER) {
1323 otmp->recharged = 1; /* degraded quality */
1329 while (otmp->otyp == WAN_WISHING || otmp->otyp == WAN_POLYMORPH)
1330 otmp->otyp = rnd_class(WAN_LIGHT, WAN_LIGHTNING);
1333 if ((int)otmp->recharged < rn2(7)) /* recharge_limit */
1334 otmp->recharged++;
1338 while (otmp->otyp == POT_POLYMORPH)
1339 otmp->otyp = rnd_class(POT_GAIN_ABILITY, POT_WATER);
1343 while (otmp->otyp == SPE_POLYMORPH)
1344 otmp->otyp = rnd_class(SPE_DIG, SPE_BLANK_PAPER);
1346 otmp->spestudied = obj->spestudied + 1;
1350 if (otmp->quan > (long) rnd(4) &&
1352 objects[otmp->otyp].oc_material != MINERAL) {
1353 otmp->otyp = ROCK; /* transmutation backfired */
1354 otmp->quan /= 2L; /* some material has been lost */
1360 otmp->owt = weight(otmp);
1372 otmp->owornmask = obj->owornmask;
1374 setworn(otmp, otmp->owornmask);
1375 if (otmp->owornmask & LEFT_RING)
1376 uleft = otmp;
1377 if (otmp->owornmask & RIGHT_RING)
1378 uright = otmp;
1379 if (otmp->owornmask & W_WEP)
1380 uwep = otmp;
1381 if (otmp->owornmask & W_SWAPWEP)
1382 uswapwep = otmp;
1383 if (otmp->owornmask & W_QUIVER)
1384 uquiver = otmp;
1390 otmp->owornmask = obj->owornmask;
1394 otmp->otyp != BOULDER)
1400 /* swap otmp for obj */
1401 replace_object(obj, otmp);
1406 * equivalent to calling freeinv on obj and addinv on otmp,
1410 addinv_core1(otmp);
1411 addinv_core2(otmp);
1414 if ((!carried(otmp) || obj->unpaid) &&
1415 get_obj_location(otmp, &ox, &oy, BURIED_TOO|CONTAINED_TOO) &&
1437 return otmp;
1441 * Object obj was hit by the effect of the wand/spell otmp. Return
1445 bhito(obj, otmp)
1446 struct obj *obj, *otmp;
1488 if (!(obj->where == OBJ_FLOOR || otmp->otyp == SPE_STONE_TO_FLESH))
1494 if (otmp->otyp == WAN_OPENING || otmp->otyp == SPE_KNOCK) {
1496 makeknown(otmp->otyp);
1500 switch(otmp->otyp) {
1513 if (Is_box(obj)) (void) boxlock(obj, otmp);
1517 makeknown(otmp->otyp);
1556 makeknown(otmp->otyp);
1590 res = boxlock(obj, otmp);
1593 if (res /* && otmp->oclass == WAND_CLASS */)
1594 makeknown(otmp->otyp);
1703 impossible("What an interesting effect (%d)", otmp->otyp);
1717 register struct obj *otmp, *next_obj;
1723 bhito(otmp) -> break_statue(otmp) -> activate_statue_trap(ox,oy)
1733 for(otmp = level.objects[tx][ty]; otmp; otmp = next_obj) {
1735 next_obj = otmp->nexthere;
1736 hitanything += (*fhito)(otmp, obj);
1814 backfire(otmp)
1815 struct obj *otmp;
1817 otmp->in_use = TRUE; /* in case losehp() is fatal */
1818 pline("%s suddenly explodes!", The(xname(otmp)));
1819 losehp(d(otmp->spe+2,6), "exploding wand", KILLED_BY_AN);
1820 useup(otmp);
2241 struct obj *otmp;
2243 for (otmp = (youdefend ? invent : mdef->minvent);
2244 otmp; otmp = otmp->nobj)
2245 cancel_item(otmp);
2291 struct obj *otmp;
2351 if ((otmp = mksobj_at(ROCK, x, y, FALSE, FALSE)) != 0) {
2352 (void)xname(otmp); /* set dknown, maybe bknown */
2353 stackobj(otmp);
3285 struct obj *otmp;
3296 tmp = zhitm(u.ustuck, type, nd, &otmp);
3356 int tmp = zhitm(mon, type, nd, &otmp);
3401 for (otmp = mon->minvent; otmp; otmp = otmp2) {
3402 otmp2 = otmp->nobj;
3403 if (!oresist_disintegration(otmp)) {
3404 obj_extract_self(otmp);
3405 obfree(otmp, (struct obj *)0);
3419 if (!otmp) {
3427 distant_name(otmp, xname));
3428 m_useup(mon, otmp);
3528 struct obj *otmp;
3546 if ((otmp = sobj_at(BOULDER, x, y)) != 0) {
3547 if (cansee(x,y)) pline("%s settles...", An(xname(otmp)));
3549 obj_extract_self(otmp); /* boulder isn't being pushed */
3550 if (!boulder_hits_pool(otmp, x, y, FALSE))
3553 } while (is_pool(x,y) && (otmp = sobj_at(BOULDER, x, y)) != 0);
4096 struct obj *otmp, nothing;
4106 * otmp == &zeroobj. That includes gold, or an artifact that
4110 otmp = readobjnam(buf, &nothing, TRUE);
4111 if (!otmp) {
4115 otmp = readobjnam((char *)0, (struct obj *)0, TRUE);
4116 if (!otmp) return; /* for safety; should never happen */
4117 } else if (otmp == &nothing) {
4126 if (otmp != &zeroobj) {
4127 /* The(aobjnam()) is safe since otmp is unidentified -dlc */
4128 (void) hold_another_object(otmp, u.uswallow ?
4136 The(aobjnam(otmp,