/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* hack.wield.c - version 1.0.3 */
extern struct obj zeroobj
;
setuwep(obj
) register struct obj
*obj
; {
register struct obj
*wep
;
if(!(wep
= getobj("#-)", "wield"))) /* nothing */;
pline("You are already wielding that!");
else if(uwep
&& uwep
->cursed
)
pline("The %s welded to your hand!",
else if(wep
== &zeroobj
) {
pline("You are already empty handed.");
setuwep((struct obj
*) 0);
pline("You are empty handed.");
} else if(uarms
&& wep
->otyp
== TWO_HANDED_SWORD
)
pline("You cannot wield a two-handed sword and wear a shield.");
else if(wep
->owornmask
& (W_ARMOR
| W_RING
))
pline("You cannot wield that!");
pline("The %s %s to your hand!",
(uwep
->quan
== 1) ? "itself" : "themselves"); /* a3 */
if(!uwep
|| uwep
->olet
!= WEAPON_SYM
) return; /* %% */
pline("Your %s not affected.", aobjnam(uwep
, "are"));
pline("Your %s!", aobjnam(uwep
, "corrode"));
register struct obj
*otmp
;
register char *color
= (amount
< 0) ? "black" : "green";
if(!uwep
|| uwep
->olet
!= WEAPON_SYM
) {
(amount
> 0) ? "Your hands twitch."
if(uwep
->otyp
== WORM_TOOTH
&& amount
> 0) {
pline("Your weapon seems sharper now.");
if(uwep
->otyp
== CRYSKNIFE
&& amount
< 0) {
pline("Your weapon looks duller now.");
/* there is a (soft) upper limit to uwep->spe */
if(amount
> 0 && uwep
->spe
> 5 && rn2(3)) {
pline("Your %s violently green for a while and then evaporate%s.",
aobjnam(uwep
, "glow"), plur(uwep
->quan
));
while(uwep
) /* let all of them disappear */
/* note: uwep->quan = 1 is nogood if unpaid */
time
= (amount
*amount
== 1) ? "moment" : "while";
pline("Your %s %s for a %s.",
aobjnam(uwep
, "glow"), color
, time
);
if(amount
> 0) uwep
->cursed
= 0;