• R/O
  • SSH
  • HTTPS

angband65: Commit


Commit MetaInfo

Revision150 (tree)
Zeit2009-05-17 03:02:34
Autorpaulblay

Log Message

This closes #16408 EXTRA_RINGS class flag needed for High Priests

Ändern Zusammenfassung

Diff

--- trunk/Angband65/src/init.h (revision 149)
+++ trunk/Angband65/src/init.h (revision 150)
@@ -84,12 +84,10 @@
8484 byte v_patch; /* Version -- patch */
8585 byte v_extra; /* Version -- extra */
8686
87-
8887 u16b info_num; /* Number of "info" records */
8988
9089 u16b info_len; /* Size of each "info" record */
9190
92-
9391 u32b head_size; /* Size of the "header" in bytes */
9492
9593 u32b info_size; /* Size of the "info" array in bytes */
@@ -106,11 +104,11 @@
106104 eval_info_post_func eval_info_post; /* Evaluate after parsing */
107105 emit_info_txt_index_func emit_info_txt_index;
108106 emit_info_txt_always_func emit_info_txt_always;
109-
110107 };
111108
112109 extern errr init_info_txt(ang_file *fp, char *buf, header *head,
113110 parse_info_txt_func parse_info_txt_line);
111+
114112 extern errr init_store_txt(ang_file *fp, char *buf);
115113
116114 extern errr eval_info(eval_info_post_func eval_info_process, header *head);
@@ -136,12 +134,10 @@
136134 extern errr eval_r_power(header *head);
137135 extern errr eval_e_slays(header *head);
138136
139-
140137 #ifdef ALLOW_TEMPLATES_OUTPUT
141138 extern errr emit_r_info_index(ang_file *fp, header *head, int i);
142139 #endif
143140
144-
145141 /*
146142 * Error tracking
147143 */
@@ -148,7 +144,6 @@
148144 extern int error_idx;
149145 extern int error_line;
150146
151-
152147 #endif /* ALLOW_TEMPLATES */
153148
154149
--- trunk/Angband65/src/object/obj-util.c (revision 149)
+++ trunk/Angband65/src/object/obj-util.c (revision 150)
@@ -485,6 +485,13 @@
485485
486486 case TV_RING:
487487 {
488+ /* High Priests can wear four rings */
489+ if (cp_ptr->flags & CF_EXTRA_RINGS)
490+ {
491+ if (!inventory[INVEN_WIELD].k_idx) return (INVEN_WIELD);
492+ if (!inventory[INVEN_BOW].k_idx) return (INVEN_BOW);
493+ }
494+
488495 /* Use the right hand first */
489496 if (!inventory[INVEN_RIGHT].k_idx) return (INVEN_RIGHT);
490497
--- trunk/Angband65/src/init2.c (revision 149)
+++ trunk/Angband65/src/init2.c (revision 150)
@@ -47,8 +47,6 @@
4747 * that the binary image files are extremely system dependant.
4848 */
4949
50-
51-
5250 /*
5351 * Find the default paths to all of our important sub-directories.
5452 *
@@ -171,7 +169,6 @@
171169 #endif /* USE_PRIVATE_PATHS */
172170 }
173171
174-
175172 #ifdef PRIVATE_USER_PATH
176173
177174 /*
@@ -227,9 +224,6 @@
227224
228225 #endif /* PRIVATE_USER_PATH */
229226
230-
231-
232-
233227 /*
234228 * Hack -- help give useful error messages
235229 */
@@ -236,7 +230,6 @@
236230 int error_idx;
237231 int error_line;
238232
239-
240233 /*
241234 * Standard error message text
242235 */
@@ -264,7 +257,6 @@
264257 "vault too big",
265258 };
266259
267-
268260 /*
269261 * File headers
270262 */
@@ -283,11 +275,8 @@
283275 header flavor_head;
284276 header s_head;
285277
286-
287-
288278 /*** Initialize from binary image files ***/
289279
290-
291280 /*
292281 * Initialize a "*_info" array, by parsing a binary "image" file
293282 */
@@ -344,7 +333,6 @@
344333 return TRUE;
345334 }
346335
347-
348336 /*
349337 * Initialize the header of an *_info.raw file.
350338 */
@@ -372,7 +360,6 @@
372360 head->emit_info_txt_always = NULL;
373361 }
374362
375-
376363 /*
377364 * Display a parser error message.
378365 */
@@ -393,7 +380,6 @@
393380 quit_fmt("Error in '%s.txt' file.", filename);
394381 }
395382
396-
397383 /*
398384 * Initialize a "*_info" array
399385 *
@@ -411,12 +397,10 @@
411397
412398 char buf[1024];
413399
414-
415400 /* Build the filenames */
416401 path_build(raw_file, sizeof(raw_file), ANGBAND_DIR_DATA, format("%s.raw", filename));
417402 path_build(txt_file, sizeof(txt_file), ANGBAND_DIR_EDIT, format("%s.txt", filename));
418403
419-
420404 #ifdef ALLOW_TEMPLATES
421405
422406 /* If the raw file's more recent than the text file, load it */
@@ -428,7 +412,6 @@
428412 return 0;
429413 }
430414
431-
432415 /*** Make the fake arrays ***/
433416
434417 /* Allocate the "*_info" array */
@@ -441,7 +424,6 @@
441424 head->text_ptr = C_ZNEW(z_info->fake_text_size, char);
442425 }
443426
444-
445427 /*** Load the ascii template file ***/
446428
447429 /* Open the file */
@@ -977,7 +959,6 @@
977959 return;
978960 }
979961
980-
981962 /*** Initialize others ***/
982963
983964 static void autoinscribe_init(void)
--- trunk/Angband65/src/defines.h (revision 149)
+++ trunk/Angband65/src/defines.h (revision 150)
@@ -215,15 +215,8 @@
215215 */
216216 #define AUTOINSCRIPTIONS_MAX 216
217217
218-#if 0 /* TODO SET RATIO */
219-#define MAX_SPELL_SET_IDX 10*RATIO /* Max number of items with spells in them */
220-#endif
221-
222218 #define MAX_SPELL_SET_IDX 10*3 /* Max number of items with spells in them */
223219
224-#if 0 /* TODO SET RATIO */
225-#define MAX_I_IDX 800*RATIO /* Max size for "i_list[]" */
226-#endif
227220 #define MAX_I_IDX 800*3 /* Max size for "i_list[]" */
228221
229222 /*
--- trunk/Angband65/src/cmd5.c (revision 149)
+++ trunk/Angband65/src/cmd5.c (revision 150)
@@ -359,7 +359,7 @@
359359 return TRUE;
360360
361361 /* High Priests can wield 2 other rings */
362- if (!(cp_ptr->flags & CF_EXTRA_RINGS))
362+ if (!(cp_ptr->flags & CF_EXTRA_RINGS))
363363 return FALSE;
364364 o_ptr = &inventory[INVEN_WIELD];
365365 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == sval))
--- trunk/Angband65/src/init1.c (revision 149)
+++ trunk/Angband65/src/init1.c (revision 150)
@@ -673,7 +673,6 @@
673673 /* Verify correct "colon" format */
674674 if (buf[1] != ':') return (PARSE_ERROR_MISSING_COLON);
675675
676-
677676 /* Hack -- Process 'V' for "Version" */
678677 if (buf[0] == 'V')
679678 {
@@ -703,16 +702,13 @@
703702 return (err);
704703 }
705704
706-
707705 /* Complete the "name" and "text" sizes */
708706 if (head->name_size) head->name_size++;
709707 if (head->text_size) head->text_size++;
710708
711-
712709 /* No version yet */
713710 if (!okay) return (PARSE_ERROR_OBSOLETE_FILE);
714711
715-
716712 /* Success */
717713 return (0);
718714 }
@@ -849,14 +845,59 @@
849845 errr init_store_txt(ang_file *fp, char *buf)
850846 {
851847 int i;
852-
853848 int store_num = -1;
854849 store_type *st_ptr;
855850
851+ /* Not ready yet */
852+ bool okay = FALSE;
853+
854+ /* Just before the first record */
856855 error_idx = -1;
856+
857+ /* Just before the first line */
857858 error_line = 0;
858859
860+ /* Get Version information first */
861+ /* TODO Check this works */
862+ while (file_getl(fp, buf, 1024))
863+ {
864+ /* Advance the line number */
865+ error_line++;
859866
867+ /* Skip comments and blank lines */
868+ if (!buf[0] || (buf[0] == '#')) continue;
869+
870+ /* Verify correct "colon" format */
871+ if (buf[1] != ':') return (PARSE_ERROR_MISSING_COLON);
872+
873+ /* Hack -- Process 'V' for "Version" */
874+ if (buf[0] == 'V')
875+ {
876+ int v1, v2, v3;
877+
878+ /* Scan for the values */
879+ if ((3 != SSCANF(buf+2, "%d.%d.%d", &v1, &v2, &v3)) ||
880+ (v1 != VERSION_MAJOR) ||
881+ (v2 != VERSION_MINOR) ||
882+ (v3 != VERSION_PATCH))
883+ {
884+ return (PARSE_ERROR_OBSOLETE_FILE); /* Was commented out */
885+ }
886+
887+ /* Okay to proceed */
888+ okay = TRUE;
889+
890+ /* Continue */
891+ break;
892+ }
893+
894+ /* No version yet */
895+ if (!okay) return (PARSE_ERROR_OBSOLETE_FILE);
896+ }
897+
898+ /* No version yet */
899+ if (!okay) return (PARSE_ERROR_OBSOLETE_FILE);
900+
860901 /* Allocate the stores */
861902 store = C_ZNEW(MAX_STORES, store_type);
862903 for (i = 0; i < MAX_STORES; i++)
@@ -870,7 +911,6 @@
870911
871912 st_ptr = NULL;
872913
873-
874914 while (file_getl(fp, buf, 1024))
875915 {
876916 error_line++;
--- trunk/Angband65/lib/edit/p_class.txt (revision 149)
+++ trunk/Angband65/lib/edit/p_class.txt (revision 150)
@@ -20,7 +20,7 @@
2020 # X:dis:dev:sav:stl:srh:fos:thn:thb:throw:dig
2121 # I:mhp:exp:sense_base:sense_div
2222 # A:max_attacks:min_weight:att_multiply
23-# M:spell-stat:first-level:max weight
23+# M:spellbook tval:spell-stat:first-level:max weight
2424 # B:spell number:level:mana:fail:exp
2525 # T:title
2626 # E:tval:sval:min:max
@@ -104,7 +104,7 @@
104104 E:wand:Acid Bolts:1:1
105105 E:spell:Magic Missile:1:1
106106 E:spell:Detect Monsters:1:1
107-F:CUMBER_GLOVE | ZERO_FAIL | BEAM
107+F:CUMBER_GLOVE | ZERO_FAIL
108108 T:Novice
109109 T:Apprentice
110110 T:Trickster
@@ -247,7 +247,7 @@
247247 I:5:15:15000:40
248248 A:0:0:0
249249 M:2:1:350
250-F:PSEUDO_ID_IMPROV | ZERO_FAIL | NO_ATTACK
250+F:PSEUDO_ID_IMPROV | ZERO_FAIL | NO_ATTACK | EXTRA_RINGS
251251 E:book:Book:1:1
252252 E:spell:Cure Light Wounds:1:1
253253 E:spell:Magic Missile:1:1
Show on old repository browser