Lines Matching refs:obj

73 static int drop(struct obj *);
74 static void dropy(struct obj *);
83 drop(struct obj *obj) in drop() argument
85 if (!obj) in drop()
87 if (obj->olet == '$') { /* pseudo object */ in drop()
88 long amount = OGOLD(obj); in drop()
99 free(obj); in drop()
102 if (obj->owornmask & (W_ARMOR | W_RING)) { in drop()
106 if (obj == uwep) { in drop()
111 setuwep((struct obj *) 0); in drop()
113 pline("You dropped %s.", doname(obj)); in drop()
114 dropx(obj); in drop()
120 dropx(struct obj *obj) in dropx() argument
122 freeinv(obj); in dropx()
123 dropy(obj); in dropx()
127 dropy(struct obj *obj) in dropy() argument
129 if (obj->otyp == CRYSKNIFE) in dropy()
130 obj->otyp = WORM_TOOTH; in dropy()
131 obj->ox = u.ux; in dropy()
132 obj->oy = u.uy; in dropy()
133 obj->nobj = fobj; in dropy()
134 fobj = obj; in dropy()
137 subfrombill(obj); in dropy()
138 stackobj(obj); in dropy()
328 struct obj *obj; in dothrow() local
332 obj = getobj("#)", "throw"); /* it is also possible to throw food */ in dothrow()
334 if (!obj || !getdir(1)) /* ask "in what direction?" */ in dothrow()
336 if (obj->owornmask & (W_ARMOR | W_RING)) { in dothrow()
342 if (obj == uwep) { in dothrow()
343 if (obj->cursed) { in dothrow()
347 if (obj->quan > 1) in dothrow()
348 setuwep(splitobj(obj, 1)); in dothrow()
350 setuwep((struct obj *) 0); in dothrow()
351 } else if (obj->quan > 1) in dothrow()
352 (void) splitobj(obj, 1); in dothrow()
353 freeinv(obj); in dothrow()
361 Doname(obj)); /* note: obj->quan == 1 */ in dothrow()
362 if (obj->olet == POTION_SYM) in dothrow()
363 potionhit(&youmonst, obj); in dothrow()
367 losehp(uarmh ? 1 : rnd((int) (obj->owt)), "falling object"); in dothrow()
368 dropy(obj); in dothrow()
371 pline("%s hits the floor.", Doname(obj)); in dothrow()
372 if (obj->otyp == EXPENSIVE_CAMERA) { in dothrow()
374 obfree(obj, Null(obj)); in dothrow()
375 } else if (obj->otyp == EGG) { in dothrow()
377 obfree(obj, Null(obj)); in dothrow()
378 } else if (obj->olet == POTION_SYM) { in dothrow()
380 potionbreathe(obj); in dothrow()
381 obfree(obj, Null(obj)); in dothrow()
383 dropy(obj); in dothrow()
387 } else if (obj->otyp == BOOMERANG) { in dothrow()
390 (void) addinv(obj); in dothrow()
394 if (obj->otyp == PICK_AXE && shkcatch(obj)) in dothrow()
397 mon = bhit(u.dx, u.dy, (obj->otyp == ICE_BOX) ? 1 : in dothrow()
398 (!Punished || obj != uball) ? 8 : !u.ustuck ? 5 : 1, in dothrow()
399 obj->olet, in dothrow()
400 (void (*)(struct monst *, struct obj *)) 0, in dothrow()
401 (int (*)(struct obj *, struct obj *)) 0, obj); in dothrow()
407 if (obj->olet == WEAPON_SYM) { in dothrow()
409 if (obj->otyp < ROCK) { in dothrow()
411 uwep->otyp != obj->otyp + (BOW - ARROW)) in dothrow()
416 } else if (obj->otyp == BOOMERANG) in dothrow()
418 tmp += obj->spe; in dothrow()
420 if (hmon(mon, obj, 1) == TRUE) { in dothrow()
423 cutworm(mon, bhitpos.x, bhitpos.y, obj->otyp); in dothrow()
428 if (obj->otyp < BOOMERANG && rn2(3)) { in dothrow()
430 obfree(obj, (struct obj *) 0); in dothrow()
434 miss(objects[obj->otyp].oc_name, mon); in dothrow()
435 } else if (obj->otyp == HEAVY_IRON_BALL) { in dothrow()
437 if (!Punished || obj != uball) in dothrow()
442 if (hmon(mon, obj, 1) == FALSE) in dothrow()
446 } else if (obj->olet == POTION_SYM && u.ulevel > rn2(15)) { in dothrow()
447 potionhit(mon, obj); in dothrow()
454 if (obj->olet == FOOD_SYM && mon->data->mlet == 'd') in dothrow()
455 if (tamedog(mon, obj)) in dothrow()
457 if (obj->olet == GEM_SYM && mon->data->mlet == 'u' && in dothrow()
459 if (obj->dknown && objects[obj->otyp].oc_name_known) { in dothrow()
460 if (objects[obj->otyp].g_val > 0) { in dothrow()
474 mpickobj(mon, obj); in dothrow()
482 if (obj->otyp == CRYSKNIFE) in dothrow()
483 obj->otyp = WORM_TOOTH; in dothrow()
484 obj->ox = bhitpos.x; in dothrow()
485 obj->oy = bhitpos.y; in dothrow()
486 obj->nobj = fobj; in dothrow()
487 fobj = obj; in dothrow()
490 stackobj(obj); in dothrow()
491 if (Punished && obj == uball && in dothrow()
524 struct obj *
525 splitobj(struct obj *obj, int num) in splitobj() argument
527 struct obj *otmp; in splitobj()
529 *otmp = *obj; /* copies whole structure */ in splitobj()
532 obj->quan = num; in splitobj()
533 obj->owt = weight(obj); in splitobj()
536 obj->nobj = otmp; in splitobj()
537 if (obj->unpaid) in splitobj()
538 splitbill(obj, otmp); in splitobj()