Lines Matching refs:obj
75 static int drop(struct obj *);
84 drop(struct obj *obj) in drop() argument
86 if(!obj) return(0); in drop()
87 if(obj->olet == '$') { /* pseudo object */ in drop()
88 long amount = OGOLD(obj); in drop()
98 free(obj); in drop()
101 if(obj->owornmask & (W_ARMOR | W_RING)){ in drop()
105 if(obj == uwep) { in drop()
110 setuwep((struct obj *) 0); in drop()
112 pline("You dropped %s.", doname(obj)); in drop()
113 dropx(obj); in drop()
119 dropx(struct obj *obj) in dropx() argument
121 freeinv(obj); in dropx()
122 dropy(obj); in dropx()
126 dropy(struct obj *obj) in dropy() argument
128 if(obj->otyp == CRYSKNIFE) in dropy()
129 obj->otyp = WORM_TOOTH; in dropy()
130 obj->ox = u.ux; in dropy()
131 obj->oy = u.uy; in dropy()
132 obj->nobj = fobj; in dropy()
133 fobj = obj; in dropy()
135 subfrombill(obj); in dropy()
136 stackobj(obj); in dropy()
324 struct obj *obj; in dothrow() local
328 obj = getobj("#)", "throw"); /* it is also possible to throw food */ in dothrow()
330 if(!obj || !getdir(1)) /* ask "in what direction?" */ in dothrow()
332 if(obj->owornmask & (W_ARMOR | W_RING)){ in dothrow()
339 if(obj == uwep){ in dothrow()
340 if(obj->cursed){ in dothrow()
344 if(obj->quan > 1) in dothrow()
345 setuwep(splitobj(obj, 1)); in dothrow()
347 setuwep((struct obj *) 0); in dothrow()
349 else if(obj->quan > 1) in dothrow()
350 (void) splitobj(obj, 1); in dothrow()
351 freeinv(obj); in dothrow()
359 Doname(obj)); /* note: obj->quan == 1 */ in dothrow()
360 if(obj->olet == POTION_SYM) in dothrow()
361 potionhit(&youmonst, obj); in dothrow()
364 losehp(uarmh ? 1 : rnd((int)(obj->owt)), "falling object"); in dothrow()
365 dropy(obj); in dothrow()
368 pline("%s hits the floor.", Doname(obj)); in dothrow()
369 if(obj->otyp == EXPENSIVE_CAMERA) { in dothrow()
371 obfree(obj, Null(obj)); in dothrow()
372 } else if(obj->otyp == EGG) { in dothrow()
374 obfree(obj, Null(obj)); in dothrow()
375 } else if(obj->olet == POTION_SYM) { in dothrow()
377 potionbreathe(obj); in dothrow()
378 obfree(obj, Null(obj)); in dothrow()
380 dropy(obj); in dothrow()
384 } else if(obj->otyp == BOOMERANG) { in dothrow()
387 (void) addinv(obj); in dothrow()
391 if(obj->otyp == PICK_AXE && shkcatch(obj)) in dothrow()
394 mon = bhit(u.dx, u.dy, (obj->otyp == ICE_BOX) ? 1 : in dothrow()
395 (!Punished || obj != uball) ? 8 : !u.ustuck ? 5 : 1, in dothrow()
396 obj->olet, NULL, NULL, obj); in dothrow()
402 if(obj->olet == WEAPON_SYM) { in dothrow()
404 if(obj->otyp < ROCK) { in dothrow()
406 uwep->otyp != obj->otyp+(BOW-ARROW)) in dothrow()
412 if(obj->otyp == BOOMERANG) tmp += 4; in dothrow()
413 tmp += obj->spe; in dothrow()
415 if(hmon(mon,obj,1) == TRUE){ in dothrow()
418 cutworm(mon,bhitpos.x,bhitpos.y,obj->otyp); in dothrow()
422 if(obj->otyp < BOOMERANG && rn2(3)) { in dothrow()
424 obfree(obj, (struct obj *) 0); in dothrow()
427 } else miss(objects[obj->otyp].oc_name, mon); in dothrow()
428 } else if(obj->otyp == HEAVY_IRON_BALL) { in dothrow()
430 if(!Punished || obj != uball) tmp += 2; in dothrow()
433 if(hmon(mon,obj,1) == FALSE) in dothrow()
436 } else if(obj->olet == POTION_SYM && u.ulevel > rn2(15)) { in dothrow()
437 potionhit(mon, obj); in dothrow()
443 if(obj->olet == FOOD_SYM && mon->data->mlet == 'd') in dothrow()
444 if(tamedog(mon,obj)) return(1); in dothrow()
445 if(obj->olet == GEM_SYM && mon->data->mlet == 'u' && in dothrow()
447 if(obj->dknown && objects[obj->otyp].oc_name_known){ in dothrow()
448 if(objects[obj->otyp].g_val > 0){ in dothrow()
462 mpickobj(mon, obj); in dothrow()
470 if(obj->otyp == CRYSKNIFE) in dothrow()
471 obj->otyp = WORM_TOOTH; in dothrow()
472 obj->ox = bhitpos.x; in dothrow()
473 obj->oy = bhitpos.y; in dothrow()
474 obj->nobj = fobj; in dothrow()
475 fobj = obj; in dothrow()
478 stackobj(obj); in dothrow()
479 if(Punished && obj == uball && in dothrow()
511 struct obj *
512 splitobj(struct obj *obj, int num) in splitobj() argument
514 struct obj *otmp; in splitobj()
517 *otmp = *obj; /* copies whole structure */ in splitobj()
520 obj->quan = num; in splitobj()
521 obj->owt = weight(obj); in splitobj()
524 obj->nobj = otmp; in splitobj()
525 if(obj->unpaid) splitbill(obj,otmp); in splitobj()