/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* hack.do_wear.c - version 1.0.3 */
off_msg(otmp
) register struct obj
*otmp
; {
pline("You were wearing %s.", doname(otmp
));
register struct obj
*otmp
;
if(!uarm
&& !uarmh
&& !uarms
&& !uarmg
) {
pline("Not wearing any armor.");
otmp
= (!uarmh
&& !uarms
&& !uarmg
) ? uarm
:
(!uarms
&& !uarm
&& !uarmg
) ? uarmh
:
(!uarmh
&& !uarm
&& !uarmg
) ? uarms
:
(!uarmh
&& !uarm
&& !uarms
) ? uarmg
:
if(!(otmp
->owornmask
& (W_ARMOR
- W_ARM2
))) {
pline("You can't take that off.");
if( otmp
== uarmg
&& uwep
&& uwep
->cursed
) { /* myers@uwmacc */
pline("You seem not able to take off the gloves while holding your weapon.");
pline("Not wearing any ring.");
if(uleft
&& uright
) while(1) {
pline("What ring, Right or Left? [ rl?]");
if(index(quitchars
, (answer
= readchar())))
/* might look at morc here %% */
dorr(otmp
) register struct obj
*otmp
; {
if(cursed(otmp
)) return(0);
cursed(otmp
) register struct obj
*otmp
; {
pline("You can't. It appears to be cursed.");
armoroff(otmp
) register struct obj
*otmp
; {
register int delay
= -objects
[otmp
->otyp
].oc_delay
;
if(cursed(otmp
)) return(0);
setworn((struct obj
*) 0, otmp
->owornmask
& W_ARMOR
);
nomovemsg
= "You finished taking off your helmet.";
nomovemsg
= "You finished taking off your gloves";
nomovemsg
= "You finished taking off your suit.";
register struct obj
*otmp
;
otmp
= getobj("[", "wear");
if(otmp
->owornmask
& W_ARMOR
) {
pline("You are already wearing that!");
if(otmp
->otyp
== HELMET
){
pline("You are already wearing a helmet.");
} else if(otmp
->otyp
== SHIELD
){
if(uarms
) pline("You are already wearing a shield."), err
++;
if(uwep
&& uwep
->otyp
== TWO_HANDED_SWORD
)
pline("You cannot wear a shield and wield a two-handed sword."), err
++;
} else if(otmp
->otyp
== PAIR_OF_GLOVES
) {
pline("You are already wearing gloves.");
if(uwep
&& uwep
->cursed
) {
pline("You cannot wear gloves over your weapon.");
if(otmp
->otyp
!= ELVEN_CLOAK
|| uarm2
) {
pline("You are already wearing some armor.");
if(otmp
== uwep
&& uwep
->cursed
) {
pline("%s is welded to your hand.", Doname(uwep
));
setuwep((struct obj
*) 0);
delay
= -objects
[otmp
->otyp
].oc_delay
;
nomovemsg
= "You finished your dressing manoeuvre.";
register struct obj
*otmp
;
pline("There are no more ring-fingers to fill.");
otmp
= getobj("=", "wear");
if(otmp
->owornmask
& W_RING
) {
pline("You are already wearing that!");
if(otmp
== uleft
|| otmp
== uright
) {
pline("You are already wearing that.");
if(otmp
== uwep
&& uwep
->cursed
) {
pline("%s is welded to your hand.", Doname(uwep
));
if(uleft
) mask
= RIGHT_RING
;
else if(uright
) mask
= LEFT_RING
;
pline("What ring-finger, Right or Left? ");
if(index(quitchars
, (answer
= readchar())))
setuwep((struct obj
*) 0);
oldprop
= u
.uprops
[PROP(otmp
->otyp
)].p_flgs
;
u
.uprops
[PROP(otmp
->otyp
)].p_flgs
|= mask
;
case RIN_PROTECTION_FROM_SHAPE_CHANGERS
:
if(u
.ustr
> 118) u
.ustr
= 118;
if(u
.ustrmax
> 118) u
.ustrmax
= 118;
case RIN_INCREASE_DAMAGE
:
register struct obj
*obj
;
mask
= obj
->owornmask
& W_RING
;
setworn((struct obj
*) 0, obj
->owornmask
);
if(!(u
.uprops
[PROP(obj
->otyp
)].p_flgs
& mask
))
impossible("Strange... I didnt know you had that ring.");
u
.uprops
[PROP(obj
->otyp
)].p_flgs
&= ~mask
;
case RIN_FIRE_RESISTANCE
:
/* Bad luck if the player is in hell... --jgm */
if (!Fire_resistance
&& dlevel
>= 30) {
pline("The flames of Hell burn you to a crisp.");
killer
= "stupidity in hell";
if(!Levitation
) { /* no longer floating */
if(u
.ustr
> 118) u
.ustr
= 118;
if(u
.ustrmax
> 118) u
.ustrmax
= 118;
case RIN_INCREASE_DAMAGE
:
if(uarm
) uac
-= ARM_BONUS(uarm
);
if(uarm2
) uac
-= ARM_BONUS(uarm2
);
if(uarmh
) uac
-= ARM_BONUS(uarmh
);
if(uarms
) uac
-= ARM_BONUS(uarms
);
if(uarmg
) uac
-= ARM_BONUS(uarmg
);
if(uleft
&& uleft
->otyp
== RIN_PROTECTION
) uac
-= uleft
->spe
;
if(uright
&& uright
->otyp
== RIN_PROTECTION
) uac
-= uright
->spe
;
register struct obj
*otmp
;
if(!uarmg
) if(uleft
|| uright
) {
/* Note: at present also cursed rings fall off */
pline("Your %s off your fingers.",
(uleft
&& uright
) ? "rings slip" : "ring slips");
if((otmp
= uleft
) != Null(obj
)){
if((otmp
= uright
) != Null(obj
)){
if((otmp
= uwep
) != Null(obj
)){
/* Note: at present also cursed weapons fall */
setuwep((struct obj
*) 0);
pline("Your weapon %sslips from your hands.",
register struct obj
*otmph
= uarm
;
if(uarmh
&& (!otmph
|| !rn2(4))) otmph
= uarmh
;
if(uarmg
&& (!otmph
|| !rn2(4))) otmph
= uarmg
;
if(uarms
&& (!otmph
|| !rn2(4))) otmph
= uarms
;
register struct obj
*otmph
= some_armor();
otmph
->otyp
== ELVEN_CLOAK
||
otmph
->otyp
== LEATHER_ARMOR
||
otmph
->otyp
== STUDDED_LEATHER_ARMOR
) {
pline("Your %s not affected!",
pline("Your %s!", aobjnam(otmph
, "corrode"));