]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - hack/hack.wield.c
2 * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
6 static char rcsid
[] = "$NetBSD: hack.wield.c,v 1.3 1995/03/23 08:32:06 cgd Exp $";
10 extern struct obj zeroobj
;
12 setuwep(obj
) register struct obj
*obj
; {
18 register struct obj
*wep
;
22 if(!(wep
= getobj("#-)", "wield"))) /* nothing */;
24 pline("You are already wielding that!");
25 else if(uwep
&& uwep
->cursed
)
26 pline("The %s welded to your hand!",
27 aobjnam(uwep
, "are"));
28 else if(wep
== &zeroobj
) {
30 pline("You are already empty handed.");
32 setuwep((struct obj
*) 0);
34 pline("You are empty handed.");
36 } else if(uarms
&& wep
->otyp
== TWO_HANDED_SWORD
)
37 pline("You cannot wield a two-handed sword and wear a shield.");
38 else if(wep
->owornmask
& (W_ARMOR
| W_RING
))
39 pline("You cannot wield that!");
44 pline("The %s %s to your hand!",
45 aobjnam(uwep
, "weld"),
46 (uwep
->quan
== 1) ? "itself" : "themselves"); /* a3 */
53 if(!uwep
|| uwep
->olet
!= WEAPON_SYM
) return; /* %% */
55 pline("Your %s not affected.", aobjnam(uwep
, "are"));
57 pline("Your %s!", aobjnam(uwep
, "corrode"));
63 register struct obj
*otmp
;
66 register char *color
= (amount
< 0) ? "black" : "green";
68 if(!uwep
|| uwep
->olet
!= WEAPON_SYM
) {
70 (amount
> 0) ? "Your hands twitch."
71 : "Your hands itch.");
75 if(uwep
->otyp
== WORM_TOOTH
&& amount
> 0) {
76 uwep
->otyp
= CRYSKNIFE
;
77 pline("Your weapon seems sharper now.");
82 if(uwep
->otyp
== CRYSKNIFE
&& amount
< 0) {
83 uwep
->otyp
= WORM_TOOTH
;
84 pline("Your weapon looks duller now.");
88 /* there is a (soft) upper limit to uwep->spe */
89 if(amount
> 0 && uwep
->spe
> 5 && rn2(3)) {
90 pline("Your %s violently green for a while and then evaporate%s.",
91 aobjnam(uwep
, "glow"), plur(uwep
->quan
));
92 while(uwep
) /* let all of them disappear */
93 /* note: uwep->quan = 1 is nogood if unpaid */
97 if(!rn2(6)) amount
*= 2;
98 time
= (amount
*amount
== 1) ? "moment" : "while";
99 pline("Your %s %s for a %s.",
100 aobjnam(uwep
, "glow"), color
, time
);
102 if(amount
> 0) uwep
->cursed
= 0;