Lines Matching refs:obj
78 static int drop(struct obj *);
79 static void dropy(struct obj *);
88 drop(struct obj *obj) in drop() argument
90 if (!obj) in drop()
92 if (obj->olet == '$') { /* pseudo object */ in drop()
93 long amount = OGOLD(obj); in drop()
104 free(obj); in drop()
107 if (obj->owornmask & (W_ARMOR | W_RING)) { in drop()
111 if (obj == uwep) { in drop()
116 setuwep((struct obj *) 0); in drop()
118 pline("You dropped %s.", doname(obj)); in drop()
119 dropx(obj); in drop()
125 dropx(struct obj *obj) in dropx() argument
127 freeinv(obj); in dropx()
128 dropy(obj); in dropx()
132 dropy(struct obj *obj) in dropy() argument
134 if (obj->otyp == CRYSKNIFE) in dropy()
135 obj->otyp = WORM_TOOTH; in dropy()
136 obj->ox = u.ux; in dropy()
137 obj->oy = u.uy; in dropy()
138 obj->nobj = fobj; in dropy()
139 fobj = obj; in dropy()
142 subfrombill(obj); in dropy()
143 stackobj(obj); in dropy()
333 struct obj *obj; in dothrow() local
337 obj = getobj("#)", "throw"); /* it is also possible to throw food */ in dothrow()
339 if (!obj || !getdir(1)) /* ask "in what direction?" */ in dothrow()
341 if (obj->owornmask & (W_ARMOR | W_RING)) { in dothrow()
347 if (obj == uwep) { in dothrow()
348 if (obj->cursed) { in dothrow()
352 if (obj->quan > 1) in dothrow()
353 setuwep(splitobj(obj, 1)); in dothrow()
355 setuwep((struct obj *) 0); in dothrow()
356 } else if (obj->quan > 1) in dothrow()
357 (void) splitobj(obj, 1); in dothrow()
358 freeinv(obj); in dothrow()
366 Doname(obj)); /* note: obj->quan == 1 */ in dothrow()
367 if (obj->olet == POTION_SYM) in dothrow()
368 potionhit(&youmonst, obj); in dothrow()
372 losehp(uarmh ? 1 : rnd((int) (obj->owt)), "falling object"); in dothrow()
373 dropy(obj); in dothrow()
376 pline("%s hits the floor.", Doname(obj)); in dothrow()
377 if (obj->otyp == EXPENSIVE_CAMERA) { in dothrow()
379 obfree(obj, Null(obj)); in dothrow()
380 } else if (obj->otyp == EGG) { in dothrow()
382 obfree(obj, Null(obj)); in dothrow()
383 } else if (obj->olet == POTION_SYM) { in dothrow()
385 potionbreathe(obj); in dothrow()
386 obfree(obj, Null(obj)); in dothrow()
388 dropy(obj); in dothrow()
392 } else if (obj->otyp == BOOMERANG) { in dothrow()
395 (void) addinv(obj); in dothrow()
399 if (obj->otyp == PICK_AXE && shkcatch(obj)) in dothrow()
402 mon = bhit(u.dx, u.dy, (obj->otyp == ICE_BOX) ? 1 : in dothrow()
403 (!Punished || obj != uball) ? 8 : !u.ustuck ? 5 : 1, in dothrow()
404 obj->olet, in dothrow()
405 (void (*)(struct monst *, struct obj *)) 0, in dothrow()
406 (int (*)(struct obj *, struct obj *)) 0, obj); in dothrow()
412 if (obj->olet == WEAPON_SYM) { in dothrow()
414 if (obj->otyp < ROCK) { in dothrow()
416 uwep->otyp != obj->otyp + (BOW - ARROW)) in dothrow()
421 } else if (obj->otyp == BOOMERANG) in dothrow()
423 tmp += obj->spe; in dothrow()
425 if (hmon(mon, obj, 1) == TRUE) { in dothrow()
428 cutworm(mon, bhitpos.x, bhitpos.y, obj->otyp); in dothrow()
433 if (obj->otyp < BOOMERANG && rn2(3)) { in dothrow()
435 obfree(obj, (struct obj *) 0); in dothrow()
439 miss(objects[obj->otyp].oc_name, mon); in dothrow()
440 } else if (obj->otyp == HEAVY_IRON_BALL) { in dothrow()
442 if (!Punished || obj != uball) in dothrow()
447 if (hmon(mon, obj, 1) == FALSE) in dothrow()
451 } else if (obj->olet == POTION_SYM && u.ulevel > rn2(15)) { in dothrow()
452 potionhit(mon, obj); in dothrow()
459 if (obj->olet == FOOD_SYM && mon->data->mlet == 'd') in dothrow()
460 if (tamedog(mon, obj)) in dothrow()
462 if (obj->olet == GEM_SYM && mon->data->mlet == 'u' && in dothrow()
464 if (obj->dknown && objects[obj->otyp].oc_name_known) { in dothrow()
465 if (objects[obj->otyp].g_val > 0) { in dothrow()
479 mpickobj(mon, obj); in dothrow()
487 if (obj->otyp == CRYSKNIFE) in dothrow()
488 obj->otyp = WORM_TOOTH; in dothrow()
489 obj->ox = bhitpos.x; in dothrow()
490 obj->oy = bhitpos.y; in dothrow()
491 obj->nobj = fobj; in dothrow()
492 fobj = obj; in dothrow()
495 stackobj(obj); in dothrow()
496 if (Punished && obj == uball && in dothrow()
529 struct obj *
530 splitobj(struct obj *obj, int num) in splitobj() argument
532 struct obj *otmp; in splitobj()
534 *otmp = *obj; /* copies whole structure */ in splitobj()
537 obj->quan = num; in splitobj()
538 obj->owt = weight(obj); in splitobj()
541 obj->nobj = otmp; in splitobj()
542 if (obj->unpaid) in splitobj()
543 splitbill(obj, otmp); in splitobj()