return TRUE if artifact object's invoke cost can be paid (and pay it) */
| 2103 | |
| 2104 | /* return TRUE if artifact object's invoke cost can be paid (and pay it) */ |
| 2105 | staticfn boolean |
| 2106 | arti_invoke_cost(struct obj *obj) |
| 2107 | { |
| 2108 | if (obj->age > svm.moves) { |
| 2109 | int pw_cost = arti_invoke_cost_pw(obj); |
| 2110 | |
| 2111 | if (pw_cost < 0 || u.uen < pw_cost) { |
| 2112 | /* the artifact is tired :-) */ |
| 2113 | You_feel("that %s %s ignoring you.", the(xname(obj)), |
| 2114 | otense(obj, "are")); |
| 2115 | /* and just got more so; patience is essential... */ |
| 2116 | obj->age += (long) d(3, 10); |
| 2117 | return FALSE; |
| 2118 | } else { |
| 2119 | /* you pay invoke cost with your own magic */ |
| 2120 | You_feel("drained..."); |
| 2121 | u.uen -= pw_cost; |
| 2122 | disp.botl = TRUE; |
| 2123 | } |
| 2124 | } else { |
| 2125 | obj->age = svm.moves + rnz(100); |
| 2126 | } |
| 2127 | return TRUE; |
| 2128 | } |
| 2129 | |
| 2130 | staticfn int |
| 2131 | arti_invoke(struct obj *obj) |
no test coverage detected