… | |
… | |
63 | uint64 seq; |
63 | uint64 seq; |
64 | }; |
64 | }; |
65 | |
65 | |
66 | extern void init_uuid (); |
66 | extern void init_uuid (); |
67 | extern UUID gen_uuid (); |
67 | extern UUID gen_uuid (); |
|
|
68 | extern const uint64 UUID_SKIP; |
68 | |
69 | |
69 | /* Definition for WILL_APPLY values. Replaces having harcoded values |
70 | /* Definition for WILL_APPLY values. Replaces having harcoded values |
70 | * sprinkled in the code. Note that some of these also replace fields |
71 | * sprinkled in the code. Note that some of these also replace fields |
71 | * that were in the can_apply area. What is the point of having both |
72 | * that were in the can_apply area. What is the point of having both |
72 | * can_apply and will_apply? |
73 | * can_apply and will_apply? |
… | |
… | |
81 | * don't just want it copied, so you'll need to add to common/object.C, |
82 | * don't just want it copied, so you'll need to add to common/object.C, |
82 | * e.g. copy_object. |
83 | * e.g. copy_object. |
83 | */ |
84 | */ |
84 | |
85 | |
85 | typedef refptr<object> object_ptr; |
86 | typedef refptr<object> object_ptr; |
|
|
87 | typedef refptr<archetype> arch_ptr; |
86 | |
88 | |
87 | // these are not being copied |
89 | // these are not being copied |
88 | ACC_CLASS (object) |
90 | ACC_CLASS (object) |
89 | struct object_keep : refcounted |
91 | struct object_keep : refcounted |
90 | { |
92 | { |
91 | tag_t ACC (RW, count); /* Generation count for this object */ |
93 | tag_t ACC (RW, count); /* Generation count for this object */ |
92 | UUID uuid; // Unique Identifier, survives saves etc. |
94 | UUID ACC (RW, uuid); // Unique Identifier, survives saves etc. |
93 | |
95 | |
94 | /* These variables are not changed by copy_object() */ |
96 | /* These variables are not changed by copy_object() */ |
95 | player *ACC (RW, contr); /* Pointer to the player which control this object */ |
97 | player *ACC (RW, contr); /* Pointer to the player which control this object */ |
96 | object *ACC (RW, next); /* Pointer to the next object in the free/used list */ |
98 | object *ACC (RW, next); /* Pointer to the next object in the free/used list */ |
97 | object *ACC (RW, prev); /* Pointer to the previous object in the free/used list */ |
99 | object *ACC (RW, prev); /* Pointer to the previous object in the free/used list */ |
… | |
… | |
209 | uint8 ACC (RW, range_modifier); /* How going up in level effects range */ |
211 | uint8 ACC (RW, range_modifier); /* How going up in level effects range */ |
210 | char *ACC (RW, spellarg); |
212 | char *ACC (RW, spellarg); |
211 | |
213 | |
212 | /* Following are values used by any object */ |
214 | /* Following are values used by any object */ |
213 | treasurelist *ACC (RW, randomitems); /* Items to be generated */ |
215 | treasurelist *ACC (RW, randomitems); /* Items to be generated */ |
214 | archetype *ACC (RW, arch); /* Pointer to archetype */ |
216 | arch_ptr ACC (RW, arch); /* Pointer to archetype */ |
215 | archetype *ACC (RW, other_arch); /* Pointer used for various things - mostly used for what */ |
217 | arch_ptr ACC (RW, other_arch); /* Pointer used for various things - mostly used for what */ |
216 | key_value *key_values; /* Fields not explictly known by the loader. */ |
218 | key_value *key_values; /* Fields not explictly known by the loader. */ |
217 | /* this objects turns into or what this object creates */ |
219 | /* this objects turns into or what this object creates */ |
218 | uint32 flags[4]; /* various flags */ |
220 | uint32 flags[4]; /* various flags */ |
219 | uint16 ACC (RW, animation_id); /* An index into the animation array */ |
221 | uint16 ACC (RW, animation_id); /* An index into the animation array */ |
220 | uint8 ACC (RW, anim_speed); /* ticks between animation-frames */ |
222 | uint8 ACC (RW, anim_speed); /* ticks between animation-frames */ |
… | |
… | |
347 | * be much left in the archetype - all it really is is a holder for the |
349 | * be much left in the archetype - all it really is is a holder for the |
348 | * object and pointers. This structure should get removed, and just replaced |
350 | * object and pointers. This structure should get removed, and just replaced |
349 | * by the object structure |
351 | * by the object structure |
350 | */ |
352 | */ |
351 | |
353 | |
352 | ACC_CLASS(archetype) |
354 | ACC_CLASS (archetype) |
353 | struct archetype : zero_initialised |
355 | struct archetype : zero_initialised, refcounted |
354 | { |
356 | { |
355 | archetype (); |
357 | archetype (); |
356 | ~archetype (); |
358 | ~archetype (); |
357 | |
359 | |
358 | static archetype *find (const char *arch); |
360 | static archetype *find (const char *arch); |
|
|
361 | |
|
|
362 | void hash_add (); // add to hastable |
|
|
363 | void hash_del (); // remove from hashtable |
359 | |
364 | |
360 | shstr ACC (RW, name); /* More definite name, like "generate_kobold" */ |
365 | shstr ACC (RW, name); /* More definite name, like "generate_kobold" */ |
361 | struct archetype *ACC (RW, next); /* Next archetype in a linked list */ |
366 | struct archetype *ACC (RW, next); /* Next archetype in a linked list */ |
362 | struct archetype *ACC (RW, head); /* The main part of a linked object */ |
367 | struct archetype *ACC (RW, head); /* The main part of a linked object */ |
363 | struct archetype *ACC (RW, more); /* Next part of a linked object */ |
368 | struct archetype *ACC (RW, more); /* Next part of a linked object */ |
… | |
… | |
425 | #define ARCH_DETECT_MAGIC "detect_magic" |
430 | #define ARCH_DETECT_MAGIC "detect_magic" |
426 | #define ARCH_DEPLETION "depletion" |
431 | #define ARCH_DEPLETION "depletion" |
427 | #define ARCH_SYMPTOM "symptom" |
432 | #define ARCH_SYMPTOM "symptom" |
428 | |
433 | |
429 | #endif |
434 | #endif |
|
|
435 | |