| 1080 | } |
| 1081 | |
| 1082 | staticfn void |
| 1083 | peffect_gain_level(struct obj *otmp) |
| 1084 | { |
| 1085 | if (otmp->cursed) { |
| 1086 | boolean on_lvl_1 = (ledger_no(&u.uz) == 1); |
| 1087 | |
| 1088 | gp.potion_unkn++; |
| 1089 | /* they went up a level */ |
| 1090 | if (on_lvl_1 ? u.uhave.amulet : Can_rise_up(u.ux, u.uy, &u.uz)) { |
| 1091 | int newlev; |
| 1092 | d_level newlevel; |
| 1093 | |
| 1094 | if (on_lvl_1) { |
| 1095 | assign_level(&newlevel, &earth_level); |
| 1096 | } else { |
| 1097 | newlev = depth(&u.uz) - 1; |
| 1098 | get_level(&newlevel, newlev); |
| 1099 | if (on_level(&newlevel, &u.uz)) { |
| 1100 | pline("It tasted bad."); |
| 1101 | return; |
| 1102 | } |
| 1103 | } |
| 1104 | You("rise up, through the %s!", ceiling(u.ux, u.uy)); |
| 1105 | goto_level(&newlevel, FALSE, FALSE, FALSE); |
| 1106 | } else { |
| 1107 | You("have an uneasy feeling."); |
| 1108 | } |
| 1109 | return; |
| 1110 | } |
| 1111 | pluslvl(FALSE); |
| 1112 | /* blessed potions place you at a random spot in the |
| 1113 | middle of the new level instead of the low point */ |
| 1114 | if (otmp->blessed) |
| 1115 | u.uexp = rndexp(TRUE); |
| 1116 | } |
| 1117 | |
| 1118 | staticfn void |
| 1119 | peffect_healing(struct obj *otmp) |
no test coverage detected