1 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
2 /* hack.wield.c - version 1.0.3 */
3 /* $FreeBSD: src/games/hack/hack.wield.c,v 1.4 1999/11/16 10:26:38 marcel Exp $ */
4 /* $DragonFly: src/games/hack/hack.wield.c,v 1.4 2006/08/21 19:45:32 pavalos Exp $ */
7 extern struct obj zeroobj
;
10 setuwep(struct obj
*obj
)
22 if (!(wep
= getobj("#-)", "wield")))
25 pline("You are already wielding that!");
26 else if (uwep
&& uwep
->cursed
)
27 pline("The %s welded to your hand!",
28 aobjnam(uwep
, "are"));
29 else if (wep
== &zeroobj
) {
31 pline("You are already empty handed.");
35 pline("You are empty handed.");
37 } else if (uarms
&& wep
->otyp
== TWO_HANDED_SWORD
)
38 pline("You cannot wield a two-handed sword and wear a shield.");
39 else if (wep
->owornmask
& (W_ARMOR
| W_RING
))
40 pline("You cannot wield that!");
45 pline("The %s %s to your hand!",
46 aobjnam(uwep
, "weld"),
47 (uwep
->quan
== 1) ? "itself" : "themselves"); /* a3 */
57 if (!uwep
|| uwep
->olet
!= WEAPON_SYM
) /* %% */
60 pline("Your %s not affected.", aobjnam(uwep
, "are"));
62 pline("Your %s!", aobjnam(uwep
, "corrode"));
68 chwepon(struct obj
*otmp
, int amount
)
70 const char *color
= (amount
< 0) ? "black" : "green";
73 if (!uwep
|| uwep
->olet
!= WEAPON_SYM
) {
75 (amount
> 0) ? "Your hands twitch."
76 : "Your hands itch.");
80 if (uwep
->otyp
== WORM_TOOTH
&& amount
> 0) {
81 uwep
->otyp
= CRYSKNIFE
;
82 pline("Your weapon seems sharper now.");
87 if (uwep
->otyp
== CRYSKNIFE
&& amount
< 0) {
88 uwep
->otyp
= WORM_TOOTH
;
89 pline("Your weapon looks duller now.");
93 /* there is a (soft) upper limit to uwep->spe */
94 if (amount
> 0 && uwep
->spe
> 5 && rn2(3)) {
95 pline("Your %s violently green for a while and then evaporate%s.",
96 aobjnam(uwep
, "glow"), plur(uwep
->quan
));
97 while (uwep
) /* let all of them disappear */
98 /* note: uwep->quan = 1 is nogood if unpaid */
104 ltime
= (amount
* amount
== 1) ? "moment" : "while";
105 pline("Your %s %s for a %s.",
106 aobjnam(uwep
, "glow"), color
, ltime
);