MCPcopy Index your code
hub / github.com/NetHack/NetHack / invoke_create_ammo

Function invoke_create_ammo

src/artifact.c:1933–1960  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1931}
1932
1933staticfn int
1934invoke_create_ammo(struct obj *obj)
1935{
1936 struct obj *otmp = mksobj(ARROW, TRUE, FALSE);
1937
1938 if (!otmp) {
1939 nothing_special(obj);
1940 return ECMD_TIME;
1941 }
1942 otmp->blessed = obj->blessed;
1943 otmp->cursed = obj->cursed;
1944 otmp->bknown = obj->bknown;
1945 otmp->oeroded = otmp->oeroded2 = 0;
1946 if (obj->blessed) {
1947 if (otmp->spe < 0)
1948 otmp->spe = 0;
1949 otmp->quan += rnd(10);
1950 } else if (obj->cursed) {
1951 if (otmp->spe > 0)
1952 otmp->spe = 0;
1953 } else
1954 otmp->quan += rnd(5);
1955 otmp->owt = weight(otmp);
1956 otmp = hold_another_object(otmp, "Suddenly %s out.",
1957 aobjnam(otmp, "fall"), (char *) 0);
1958 nhUse(otmp);
1959 return ECMD_TIME;
1960}
1961
1962staticfn int
1963invoke_banish(struct obj *obj UNUSED)

Callers 1

arti_invokeFunction · 0.85

Calls 6

mksobjFunction · 0.85
nothing_specialFunction · 0.85
rndFunction · 0.85
weightFunction · 0.85
hold_another_objectFunction · 0.85
aobjnamFunction · 0.85

Tested by

no test coverage detected