MCPcopy Create free account
hub / github.com/NetHack/NetHack / invoke_charge_obj

Function invoke_charge_obj

src/artifact.c:1847–1864  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1845}
1846
1847staticfn int
1848invoke_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
1866staticfn int
1867invoke_create_portal(struct obj *obj)

Callers 1

arti_invokeFunction · 0.85

Calls 4

get_artifactFunction · 0.85
getobjFunction · 0.85
rechargeFunction · 0.85
update_inventoryFunction · 0.85

Tested by

no test coverage detected