found_artifact() groundwork
Lay groundwork for generating a log event when finding an artifact on the floor or carried by a monster. This part should not produce any change in behavior. Move g.artidisco[] and g.artiexist[] out of the instance_globals struct back to local within artifact.c. They are both initialized at the start of a game (and only used in that file) so don't need to be part of any bulk reinitialization if restart-instead-of-exit ever gets implemented. Convert artiexist[] from an array of booleans to an array of structs containing a pair of bitfields. artiexist[].exists is a direct replacement for the boolean; artiexist[].found is new but not put to any significant use yet. If will be used to suppress the future found-an-artifact event for cases where a more specific event (like crowning or divine gift as #offer reward) is already produced. Remove g.via_naming altogether and add an extra argument to oname() calls to replace it. Add an extra argument to artifact_exists() calls.
This commit is contained in:
+2
-2
@@ -492,7 +492,7 @@ steal(struct monst* mtmp, char* objnambuf)
|
||||
|
||||
/* Returns 1 if otmp is free'd, 0 otherwise. */
|
||||
int
|
||||
mpickobj(register struct monst* mtmp, register struct obj* otmp)
|
||||
mpickobj(struct monst *mtmp, struct obj *otmp)
|
||||
{
|
||||
int freed_otmp;
|
||||
boolean snuff_otmp = FALSE;
|
||||
@@ -706,7 +706,7 @@ mdrop_obj(
|
||||
even leaving the game entirely; when that happens, prevent them from
|
||||
taking the Amulet, invocation items, or quest artifact with them */
|
||||
void
|
||||
mdrop_special_objs(struct monst* mon)
|
||||
mdrop_special_objs(struct monst *mon)
|
||||
{
|
||||
struct obj *obj, *otmp;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user