check whether slippery clothing protects from hug or wrap attack */
| 1044 | |
| 1045 | /* check whether slippery clothing protects from hug or wrap attack */ |
| 1046 | boolean |
| 1047 | u_slip_free( |
| 1048 | struct monst *mtmp, |
| 1049 | struct attack *mattk) |
| 1050 | { |
| 1051 | struct obj *obj; |
| 1052 | |
| 1053 | /* greased armor does not protect against AT_ENGL+AD_WRAP */ |
| 1054 | if (mattk->aatyp == AT_ENGL) |
| 1055 | return FALSE; |
| 1056 | |
| 1057 | obj = (uarmc ? uarmc : uarm); |
| 1058 | if (!obj) |
| 1059 | obj = uarmu; |
| 1060 | if (mattk->adtyp == AD_DRIN) |
| 1061 | obj = uarmh; |
| 1062 | |
| 1063 | /* if your cloak/armor is greased, monster slips off; this |
| 1064 | protection might fail (33% chance) when the armor is cursed */ |
| 1065 | if (obj && (obj->greased || obj->otyp == OILSKIN_CLOAK) |
| 1066 | && (!obj->cursed || rn2(3))) { |
| 1067 | pline_mon(mtmp, "%s %s your %s %s!", Monnam(mtmp), |
| 1068 | (mattk->adtyp == AD_WRAP) ? "slips off of" |
| 1069 | : "grabs you, but cannot hold onto", |
| 1070 | obj->greased ? "greased" : "slippery", |
| 1071 | /* avoid "slippery slippery cloak" |
| 1072 | for undiscovered oilskin cloak */ |
| 1073 | (obj->greased || objects[obj->otyp].oc_name_known) |
| 1074 | ? xname(obj) |
| 1075 | : cloak_simple_name(obj)); |
| 1076 | |
| 1077 | if (obj->greased && !rn2(2)) { |
| 1078 | pline_The("grease wears off."); |
| 1079 | obj->greased = 0; |
| 1080 | update_inventory(); |
| 1081 | } |
| 1082 | return TRUE; |
| 1083 | } |
| 1084 | return FALSE; |
| 1085 | } |
| 1086 | |
| 1087 | /* armor that sufficiently covers the body might be able to block magic */ |
| 1088 | int |
no test coverage detected