]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - hack/hack.wield.c
1 /* $NetBSD: hack.wield.c,v 1.4 1997/10/19 16:59:27 christos Exp $ */
4 * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
9 __RCSID("$NetBSD: hack.wield.c,v 1.4 1997/10/19 16:59:27 christos Exp $");
29 if (!(wep
= getobj("#-)", "wield"))) /* nothing */
32 pline("You are already wielding that!");
33 else if (uwep
&& uwep
->cursed
)
34 pline("The %s welded to your hand!",
35 aobjnam(uwep
, "are"));
36 else if (wep
== &zeroobj
) {
38 pline("You are already empty handed.");
40 setuwep((struct obj
*) 0);
42 pline("You are empty handed.");
44 } else if (uarms
&& wep
->otyp
== TWO_HANDED_SWORD
)
45 pline("You cannot wield a two-handed sword and wear a shield.");
46 else if (wep
->owornmask
& (W_ARMOR
| W_RING
))
47 pline("You cannot wield that!");
52 pline("The %s %s to your hand!",
53 aobjnam(uwep
, "weld"),
54 (uwep
->quan
== 1) ? "itself" : "themselves"); /* a3 */
64 if (!uwep
|| uwep
->olet
!= WEAPON_SYM
)
67 pline("Your %s not affected.", aobjnam(uwep
, "are"));
69 pline("Your %s!", aobjnam(uwep
, "corrode"));
79 char *color
= (amount
< 0) ? "black" : "green";
81 if (!uwep
|| uwep
->olet
!= WEAPON_SYM
) {
83 (amount
> 0) ? "Your hands twitch."
84 : "Your hands itch.");
87 if (uwep
->otyp
== WORM_TOOTH
&& amount
> 0) {
88 uwep
->otyp
= CRYSKNIFE
;
89 pline("Your weapon seems sharper now.");
93 if (uwep
->otyp
== CRYSKNIFE
&& amount
< 0) {
94 uwep
->otyp
= WORM_TOOTH
;
95 pline("Your weapon looks duller now.");
98 /* there is a (soft) upper limit to uwep->spe */
99 if (amount
> 0 && uwep
->spe
> 5 && rn2(3)) {
100 pline("Your %s violently green for a while and then evaporate%s.",
101 aobjnam(uwep
, "glow"), plur(uwep
->quan
));
102 while (uwep
) /* let all of them disappear */
103 /* note: uwep->quan = 1 is nogood if unpaid */
109 time
= (amount
* amount
== 1) ? "moment" : "while";
110 pline("Your %s %s for a %s.",
111 aobjnam(uwep
, "glow"), color
, time
);