1 | /* |
1 | /* |
2 | * static char *rcsid_treasure_h = |
2 | * static char *rcsid_treasure_h = |
3 | * "$Id: treasure.h,v 1.1 2006/02/03 07:12:51 root Exp $"; |
3 | * "$Id: treasure.h,v 1.4 2006/09/03 00:18:41 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
69 | * arch parser over this clone, using the treasure list as script until an END comes. |
69 | * arch parser over this clone, using the treasure list as script until an END comes. |
70 | * This will allow ANY changes which is possible and we use ony one parser. |
70 | * This will allow ANY changes which is possible and we use ony one parser. |
71 | */ |
71 | */ |
72 | |
72 | |
73 | typedef struct _change_arch { |
73 | typedef struct _change_arch { |
74 | const char *name; /* is != NULL, copy this over the original arch name */ |
74 | shstr name; /* is != NULL, copy this over the original arch name */ |
75 | const char *title; /* is != NULL, copy this over the original arch name */ |
75 | shstr title; /* is != NULL, copy this over the original arch name */ |
76 | const char *slaying; /* is != NULL, copy this over the original arch name */ |
76 | shstr slaying; /* is != NULL, copy this over the original arch name */ |
77 | } _change_arch; |
77 | } _change_arch; |
78 | |
78 | |
79 | |
79 | |
80 | /* |
80 | /* |
81 | * treasure is one element in a linked list, which together consist of a |
81 | * treasure is one element in a linked list, which together consist of a |
82 | * complete treasure-list. Any arch can point to a treasure-list |
82 | * complete treasure-list. Any arch can point to a treasure-list |
83 | * to get generated standard treasure when an archetype of that type |
83 | * to get generated standard treasure when an archetype of that type |
84 | * is generated (from a generator) |
84 | * is generated (from a generator) |
85 | */ |
85 | */ |
86 | |
86 | |
87 | typedef struct treasurestruct { |
87 | typedef struct treasurestruct : zero_initialised |
|
|
88 | { |
88 | struct archt *item; /* Which item this link can be */ |
89 | struct archt *item; /* Which item this link can be */ |
89 | const char *name; /* If non null, name of list to use |
90 | shstr name; /* If non null, name of list to use |
90 | instead */ |
91 | instead */ |
91 | struct treasurestruct *next; /* Next treasure-item in a linked list */ |
92 | struct treasurestruct *next; /* Next treasure-item in a linked list */ |
92 | struct treasurestruct *next_yes; /* If this item was generated, use */ |
93 | struct treasurestruct *next_yes; /* If this item was generated, use */ |
93 | /* this link instead of ->next */ |
94 | /* this link instead of ->next */ |
94 | struct treasurestruct *next_no; /* If this item was not generated, */ |
95 | struct treasurestruct *next_no; /* If this item was not generated, */ |
95 | /* then continue here */ |
96 | /* then continue here */ |
96 | struct _change_arch change_arch; /* override default arch values if set in treasure list */ |
97 | struct _change_arch change_arch; /* override default arch values if set in treasure list */ |
97 | uint8 chance; /* Percent chance for this item */ |
98 | uint8 chance; /* Percent chance for this item */ |
98 | uint8 magic; /* Max magic bonus to item */ |
99 | uint8 magic; /* Max magic bonus to item */ |
99 | /* If the entry is a list transition, |
100 | /* If the entry is a list transition, |
100 | * 'magic' contains the difficulty |
101 | * 'magic' contains the difficulty |
101 | * required to go to the new list |
102 | * required to go to the new list |
102 | */ |
103 | */ |
103 | uint16 nrof; /* random 1 to nrof items are generated */ |
104 | uint16 nrof; /* random 1 to nrof items are generated */ |
104 | } treasure; |
105 | } treasure; |
105 | |
106 | |
106 | |
107 | |
107 | typedef struct treasureliststruct { |
108 | typedef struct treasureliststruct : zero_initialised |
|
|
109 | { |
108 | const char *name; /* Usually monster-name/combination */ |
110 | shstr name; /* Usually monster-name/combination */ |
109 | sint16 total_chance; /* If non-zero, only 1 item on this |
111 | sint16 total_chance; /* If non-zero, only 1 item on this |
110 | * list should be generated. The |
112 | * list should be generated. The |
111 | * total_chance contains the sum of |
113 | * total_chance contains the sum of |
112 | * the chance for this list. |
114 | * the chance for this list. |
113 | */ |
115 | */ |
114 | struct treasureliststruct *next; /* Next treasure-item in linked list */ |
116 | struct treasureliststruct *next; /* Next treasure-item in linked list */ |
115 | struct treasurestruct *items; /* Items in this list, linked */ |
117 | struct treasurestruct *items; /* Items in this list, linked */ |
116 | } treasurelist; |
118 | } treasurelist; |
117 | |
119 | |
118 | |
|
|
119 | |
|
|
120 | #endif |
120 | #endif |