| 1845 | } |
| 1846 | |
| 1847 | staticfn int |
| 1848 | invoke_charge_obj(struct obj *obj) |
| 1849 | { |
| 1850 | const struct artifact *oart = get_artifact(obj); |
| 1851 | struct obj *otmp = getobj("charge", charge_ok, |
| 1852 | GETOBJ_PROMPT | GETOBJ_ALLOWCNT); |
| 1853 | boolean b_effect; |
| 1854 | |
| 1855 | if (!otmp) { |
| 1856 | obj->age = 0; |
| 1857 | return ECMD_CANCEL; |
| 1858 | } |
| 1859 | b_effect = (obj->blessed && (oart->role == Role_switch |
| 1860 | || oart->role == NON_PM)); |
| 1861 | recharge(otmp, b_effect ? 1 : obj->cursed ? -1 : 0); |
| 1862 | update_inventory(); |
| 1863 | return ECMD_TIME; |
| 1864 | } |
| 1865 | |
| 1866 | staticfn int |
| 1867 | invoke_create_portal(struct obj *obj) |
no test coverage detected