• R/O
  • SSH
  • HTTPS

angband65: Commit


Commit MetaInfo

Revision147 (tree)
Zeit2009-05-16 17:34:19
Autorpaulblay

Log Message

This closes #16706 Can't bind spells into spell books. Also now up to date with Vanilla Angband (Changeset 1400). Note that Changeset 1379 introduced a bug so that is not yet included.

Ändern Zusammenfassung

Diff

--- trunk/Angband65/src/savefile.c (revision 146)
+++ trunk/Angband65/src/savefile.c (revision 147)
@@ -215,6 +215,31 @@
215215 str[max - 1] = '\0';
216216 }
217217
218+s16b rd_spell_set(void)
219+{
220+ int i;
221+ s16b set = s_pop();
222+ if (!set)
223+ quit("Error: too many spell_sets requested while reading savefile");
224+
225+ for (i = 0; i < (MAX_SPELLS_PER_ITEM/16); i++)
226+ {
227+ rd_u16b(&s_list[set].spells[i]);
228+ }
229+ /* we now use this set */
230+ s_list[set].inuse = TRUE;
231+ return (set);
232+}
233+
234+void wr_spell_set(object_type *o_ptr)
235+{
236+ int i;
237+ for (i = 0; i < (MAX_SPELLS_PER_ITEM/16); i++)
238+ {
239+ wr_u16b(s_list[o_ptr->spell_set].spells[i]);
240+ }
241+}
242+
218243 void strip_bytes(int n)
219244 {
220245 byte tmp8u;
--- trunk/Angband65/src/savefile.h (revision 146)
+++ trunk/Angband65/src/savefile.h (revision 147)
@@ -18,6 +18,7 @@
1818 void wr_u32b(u32b v);
1919 void wr_s32b(s32b v);
2020 void wr_string(cptr str);
21+void wr_spell_set(object_type *i_ptr);
2122
2223 /* Reading bits */
2324 void rd_byte(byte *ip);
@@ -26,10 +27,9 @@
2627 void rd_u32b(u32b *ip);
2728 void rd_s32b(s32b *ip);
2829 void rd_string(char *str, int max);
30+s16b rd_spell_set(void);
2931 void strip_bytes(int n);
3032
31-
32-
3333 /* load.c */
3434 int rd_randomizer(u32b version); /* Version supplied to all but not used? */
3535 int rd_options(u32b version); /* TODO - put version to use? */
--- trunk/Angband65/src/z-file.c (revision 146)
+++ trunk/Angband65/src/z-file.c (revision 147)
@@ -236,55 +236,6 @@
236236 return cur_len;
237237 }
238238
239-
240-
241-/*** Support for byte-swapping for endian-indepedent files ***/
242-
243-static bool is_bigendian(void)
244-{
245- int i = 1;
246- char *p = (char *)&i;
247-
248- if (p[0] != 1)
249- return TRUE;
250-
251- return FALSE;
252-}
253-
254-u16b flip_u16b(u16b arg)
255-{
256- u16b ret;
257- char *in = (char *)&arg;
258- char *out = (char *)&ret;
259-
260- if (is_bigendian())
261- return arg;
262-
263- out[0] = in[1];
264- out[1] = in[0];
265-
266- return ret;
267-}
268-
269-u32b flip_u32b(u32b arg)
270-{
271- u32b ret;
272- char *in = (char *)&arg;
273- char *out = (char *)&ret;
274-
275- if (is_bigendian())
276- return arg;
277-
278- out[0] = in[3];
279- out[1] = in[2];
280- out[2] = in[1];
281- out[3] = in[0];
282-
283- return ret;
284-}
285-
286-
287-
288239 /*** File-handling API ***/
289240
290241 /* On Windows, fwrite() and fread() are broken. */
--- trunk/Angband65/src/z-file.h (revision 146)
+++ trunk/Angband65/src/z-file.h (revision 147)
@@ -39,22 +39,6 @@
3939 */
4040 size_t path_build(char *buf, size_t len, const char *base, const char *leaf);
4141
42-
43-
44-/*** Byte-flipping functions ***/
45-
46-/**
47- * "Flip" the bits of the integer specified in `arg` to make them big-endian.
48- * Useful when writing to files intended to be portable across systems.
49- *
50- * Returns the flipped value, or the original if the current system is already
51- * big-endian.
52- */
53-u16b flip_u16b(u16b arg);
54-u32b flip_u32b(u32b arg);
55-
56-
57-
5842 /*** File access code ***/
5943
6044 /** Data types **/
--- trunk/Angband65/src/object/obj-info.c (revision 146)
+++ trunk/Angband65/src/object/obj-info.c (revision 147)
@@ -1299,7 +1299,7 @@
12991299 s16b s_pop(void) /* TODO Get this to work */
13001300 {
13011301 s16b i,j;
1302- for (i=1; i<MAX_SPELL_SET_IDX; i++)
1302+ for (i = 1; i < MAX_SPELL_SET_IDX; i++)
13031303 {
13041304 if (s_list[i].inuse == FALSE)
13051305 {
--- trunk/Angband65/src/object/obj-util.c (revision 146)
+++ trunk/Angband65/src/object/obj-util.c (revision 147)
@@ -1380,7 +1380,6 @@
13801380
13811381 object_kind *k_ptr = &k_info[o_ptr->k_idx];
13821382
1383-#ifdef POWER_PRICING
13841383 s32b power;
13851384 int a = 2;
13861385 int b = 1;
@@ -1431,7 +1430,6 @@
14311430
14321431 return (total_value);
14331432 }
1434-#endif /* POWER_PRICING */
14351433
14361434 /* Hack -- "worthless" items */
14371435 if (!k_ptr->cost)
@@ -1700,28 +1698,31 @@
17001698 {
17011699 s32b value;
17021700
1703-
1704- /* Unknown items -- acquire a base value */
17051701 if (object_known_p(o_ptr))
17061702 {
17071703 /* Cursed items -- worthless */
17081704 if (cursed_p(o_ptr)) return (0L);
17091705
1710- /* Real value (see above) */
17111706 value = object_value_real(o_ptr, qty);
17121707 }
1713-
1714- /* Known items -- acquire the actual value */
17151708 else
17161709 {
1710+ object_type object_type_body;
1711+ object_type *j_ptr = &object_type_body;
1712+
17171713 /* Hack -- Felt cursed items */
1718- if ((o_ptr->ident & (IDENT_SENSE)) && cursed_p(o_ptr)) return (0L);
1714+ if ((o_ptr->ident & IDENT_SENSE) && cursed_p(o_ptr)) return (0L);
17191715
1720- /* Base value (see above) */
1721- value = object_value_base(o_ptr) * qty;
1716+ memcpy(j_ptr, o_ptr, sizeof(object_type));
1717+ memcpy(j_ptr->flags, j_ptr->known_flags, sizeof(j_ptr->flags));
1718+ if (!(o_ptr->ident & IDENT_ATTACK))
1719+ j_ptr->to_h = j_ptr->to_d = 0;
1720+ else if (!(o_ptr->ident * IDENT_DEFENCE))
1721+ j_ptr->to_a = 0;
1722+
1723+ value = object_value_real(j_ptr, qty);
17221724 }
17231725
1724-
17251726 /* Return the final value */
17261727 return (value);
17271728 }
--- trunk/Angband65/src/object/identify.c (revision 146)
+++ trunk/Angband65/src/object/identify.c (revision 147)
@@ -72,8 +72,23 @@
7272 }
7373 }
7474
75+/**
76+ * Set the ID flag on an object if known and actual flags are the same.
77+ */
78+static void tweak_id(object_type *o_ptr)
79+{
80+ u32b f[OBJ_FLAG_N];
7581
82+ object_flags(o_ptr, f);
83+ o_ptr->known_flags[3] |= (f[3] & TR3_EASY_KNOW);
7684
85+ if (memcmp(f, o_ptr->known_flags, sizeof(f)) == 0)
86+ {
87+ object_aware(o_ptr);
88+ object_known(o_ptr);
89+ }
90+}
91+
7792 /**
7893 * Mark an object as "tried".
7994 *
@@ -83,6 +98,7 @@
8398 {
8499 k_info[o_ptr->k_idx].tried = TRUE;
85100 o_ptr->ident |= IDENT_TRIED;
101+ tweak_id(o_ptr);
86102 }
87103
88104
@@ -151,6 +167,7 @@
151167
152168 /* Notice flags */
153169 o_ptr->known_flags[flagset] |= flag;
170+ tweak_id(o_ptr);
154171
155172 for (j = 0; j < N_ELEMENTS(msgs); j++)
156173 {
@@ -179,7 +196,8 @@
179196 curses = (f[3] & TR3_CURSE_MASK);
180197
181198 /* Know whatever curse flags there are to know */
182- o_ptr->known_flags[3] |= curses;
199+ o_ptr->known_flags[3] |= curses;
200+ tweak_id(o_ptr);
183201
184202 p_ptr->notice |= PN_SQUELCH;
185203
@@ -227,6 +245,7 @@
227245 {
228246 /* Notice the flag */
229247 o_ptr->known_flags[set] |= flag;
248+ tweak_id(o_ptr);
230249
231250 /* Message */
232251 msg_format(notice_msgs[j].msg, o_name);
@@ -248,6 +267,7 @@
248267 object_type *o_ptr = &inventory[i];
249268
250269 o_ptr->ident |= IDENT_ATTACK;
270+ tweak_id(o_ptr);
251271 }
252272 /* XXX print message? */
253273 /* XXX do we need to do more about ammo? */
@@ -362,10 +382,9 @@
362382 o_ptr->ident |= IDENT_SENSE;
363383 o_ptr->known_flags[0] |= (f[0] & TR0_OBVIOUS_MASK);
364384 o_ptr->known_flags[1] |= (f[1] & TR1_OBVIOUS_MASK);
365-#if 0 /* Nothing is obvious about TR2_** */
366- o_ptr->known_flags[2] |= (f[2] & TR2_OBVIOUS_MASK);
367-#endif
385+
368386 o_ptr->known_flags[3] |= (f[3] & TR3_OBVIOUS_MASK);
387+ tweak_id(o_ptr);
369388
370389 }
371390
@@ -381,22 +400,22 @@
381400 if ((o_ptr->known_flags[0] & TR0_OBVIOUS_MASK) ||
382401 (o_ptr->known_flags[1] & TR1_OBVIOUS_MASK) ||
383402 (o_ptr->known_flags[3] & (TR3_OBVIOUS_MASK ^ TR3_BORING_MASK)))
384- return INSCRIP_SPLENDID;
385- else if (o_ptr->ident & IDENT_INDESTRUCT)
386- return INSCRIP_SPECIAL;
387- else if (!(o_ptr->ident & IDENT_SENSE))
388- return INSCRIP_NULL;
389- else if (artifact_p(o_ptr))
390- return INSCRIP_SPECIAL;
391- else if (ego_item_p(o_ptr))
392- return INSCRIP_EXCELLENT;
393- else if (o_ptr->to_a == k_ptr->to_a && o_ptr->to_h == k_ptr->to_h &&
403+ return INSCRIP_SPLENDID;
404+ else if (o_ptr->ident & IDENT_INDESTRUCT)
405+ return INSCRIP_SPECIAL;
406+ else if (!(o_ptr->ident & IDENT_SENSE) && !object_known_p(o_ptr))
407+ return INSCRIP_UNKNOWN;
408+ else if (artifact_p(o_ptr))
409+ return INSCRIP_SPECIAL;
410+ else if (ego_item_p(o_ptr))
411+ return INSCRIP_EXCELLENT;
412+ else if (o_ptr->to_a == k_ptr->to_a && o_ptr->to_h == k_ptr->to_h &&
394413 o_ptr->to_d == k_ptr->to_d)
395414 return INSCRIP_AVERAGE;
396- else if (o_ptr->to_a >= k_ptr->to_a && o_ptr->to_h >= k_ptr->to_h &&
415+ else if (o_ptr->to_a >= k_ptr->to_a && o_ptr->to_h >= k_ptr->to_h &&
397416 o_ptr->to_d >= k_ptr->to_d)
398417 return INSCRIP_MAGICAL;
399- else if (o_ptr->to_a <= k_ptr->to_a && o_ptr->to_h <= k_ptr->to_h &&
418+ else if (o_ptr->to_a <= k_ptr->to_a && o_ptr->to_h <= k_ptr->to_h &&
400419 o_ptr->to_d <= k_ptr->to_d)
401420 return INSCRIP_MAGICAL;
402421
--- trunk/Angband65/src/object/object.h (revision 146)
+++ trunk/Angband65/src/object/object.h (revision 147)
@@ -44,6 +44,7 @@
4444 INSCRIP_SPLENDID = 4, /*!< Obviously good item */
4545 INSCRIP_EXCELLENT = 5, /*!< Ego-item */
4646 INSCRIP_SPECIAL = 6, /*!< Artifact */
47+ INSCRIP_UNKNOWN = 7,
4748
4849 INSCRIP_MAX /*!< Maximum number of pseudo-ID markers */
4950 } obj_pseudo_t;
--- trunk/Angband65/src/init2.c (revision 146)
+++ trunk/Angband65/src/init2.c (revision 147)
@@ -1103,6 +1103,9 @@
11031103
11041104 /*** Prepare entity arrays ***/
11051105
1106+ /* Allocate and Wipe the spell-sets list */
1107+ s_list = C_ZNEW(z_info->s_max, spell_set_type);
1108+
11061109 /* Objects */
11071110 o_list = C_ZNEW(z_info->o_max, object_type);
11081111
--- trunk/Angband65/src/defines.h (revision 146)
+++ trunk/Angband65/src/defines.h (revision 147)
@@ -310,18 +310,18 @@
310310 *
311311 * It would be nice if we could get rid of this dependency.
312312 */
313-#define SPELL_ACID_BALL 0
314-#define SPELL_ACID_BOLT 1
315-#define SPELL_ALTER_REALITY 2
316-#define SPELL_ANNIHILATION 3
317-#define SPELL_BANISHMENT 4
318-#define SPELL_BERSERKER 5
319-#define SPELL_BLESS 6
320-#define SPELL_BLINK 7
321-#define SPELL_CALL_LIGHT 8
322-#define SPELL_CHANT 9
323-#define SPELL_CLAIRVOYANCE 10
324-#define SPELL_CLOUD_KILL 11
313+#define SPELL_ACID_BALL 0
314+#define SPELL_ACID_BOLT 1
315+#define SPELL_ALTER_REALITY 2
316+#define SPELL_ANNIHILATION 3
317+#define SPELL_BANISHMENT 4
318+#define SPELL_BERSERKER 5
319+#define SPELL_BLESS 6
320+#define SPELL_BLINK 7
321+#define SPELL_CALL_LIGHT 8
322+#define SPELL_CHANT 9
323+#define SPELL_CLAIRVOYANCE 10
324+#define SPELL_CLOUD_KILL 11
325325 #define SPELL_CREATE_COMPLEX_TRAP 12
326326 #define SPELL_CREATE_CONFUSION 13
327327 #define SPELL_CREATE_DANGEROUS_TRAP 14
@@ -328,107 +328,106 @@
328328 #define SPELL_CREATE_DEATH_TRAP 15
329329 #define SPELL_CREATE_EFFECTIVE_TRAP 16
330330 #define SPELL_CREATE_SIMPLE_TRAP 17
331-#define SPELL_CURE_CRITICAL_WOUNDS 18
331+#define SPELL_CURE_CRIT_WOUNDS 18
332332 #define SPELL_CURE_CRIT_WOUNDS_II 19
333333 #define SPELL_CURE_LIGHT_WOUNDS 20
334-#define SPELL_CURE_MEDIUM_WOUNDS 21
335334 #define SPELL_CURE_MINOR_WOUNDS 22
336335 #define SPELL_CURE_POISON 23
337-#define SPELL_CURE_MORTAL_WOUNDS 24
338-#define SPELL_CURE_SERIOUS_WOUNDS 25
336+#define SPELL_CURE_SER_WOUNDS 24
337+#define SPELL_CURE_SER_WOUNDS_II 25
339338 #define SPELL_DETECT_DOORS_STAIRS 26
340339 #define SPELL_DETECT_ENCHANTMENT 27
341-#define SPELL_DETECT_EVIL 28
342-#define SPELL_DETECT_MONSTERS 29
343-#define SPELL_DETECTION 30
344-#define SPELL_DISPEL_CURSE 31
345-#define SPELL_DISPEL_EVIL 32
346-#define SPELL_DISPEL_EVIL_II 33
347-#define SPELL_DISPEL_UNDEAD 34
348-#define SPELL_DISPEL_UNDEAD_II 35
349-#define SPELL_DIVINE_SATIATION 36
350-#define SPELL_DOOR_CREATION 37
351-#define SPELL_EARTHQUAKE 38
352-#define SPELL_ELEMENTAL_BRAND 39
353-#define SPELL_ENCHANT_ARMOR 40
354-#define SPELL_ENCHANT_WEAPON 41
355-#define SPELL_ESCAPE_LEVEL 42
356-#define SPELL_ESSENCE_OF_SPEED 43
357-#define SPELL_FIND_TRAPS 44
358-#define SPELL_FIND_TRAPS_DOORS 45
359-#define SPELL_FIRE_BALL 46
360-#define SPELL_FIRE_BOLT 47
361-#define SPELL_FROST_BALL 48
362-#define SPELL_FROST_BOLT 49
363-#define SPELL_GENOCIDE 50 /* GENOCIDE = BANISHMENT = GENOCIDE_I ? */
364-#define SPELL_GLYPH_OF_WARDING 51
365-#define SPELL_HASTE_SELF 52
366-#define SPELL_HEAL 53
367-#define SPELL_HEALING 54
368-#define SPELL_HEAVENS_WRATH 55
369-#define SPELL_HELLFIRE 56
370-#define SPELL_HEROISM 57
371-#define SPELL_HOLY_WORD 58
372-#define SPELL_ICE_STORM 59
373-#define SPELL_IDENTIFY 60
374-#define SPELL_INVULNERABILITY 61
375-#define SPELL_LIGHT_AREA 62
376-#define SPELL_LIGHTNING_BOLT 63
377-#define SPELL_MAGIC_MISSILE 64
378-#define SPELL_MAGIC_REFLECTION 65
379-#define SPELL_MASS_GENOCIDE 66
380-#define SPELL_METEOR_SWARM 67
381-#define SPELL_NEUTRALIZE_POISON 68
382-#define SPELL_OBJECT_DETECTION 69
383-#define SPELL_ORB_OF_DRAINING 70
384-#define SPELL_PERCEPTION 71
385-#define SPELL_PHASE_DOOR 72
386-#define SPELL_POLYMORPH_OTHER 73
387-#define SPELL_PORTAL 74
388-#define SPELL_PRAYER 75
389-#define SPELL_PROBING 76
340+#define SPELL_DETECT_EVIL 28
341+#define SPELL_DETECT_MONSTERS 29
342+#define SPELL_DETECTION 30
343+#define SPELL_DISPEL_CURSE 31
344+#define SPELL_DISPEL_EVIL 32
345+#define SPELL_DISPEL_EVIL_II 33
346+#define SPELL_DISPEL_UNDEAD 34
347+#define SPELL_DISPEL_UNDEAD_II 35
348+#define SPELL_DIVINE_SATIATION 36
349+#define SPELL_DOOR_CREATION 37
350+#define SPELL_EARTHQUAKE 38
351+#define SPELL_ELEMENTAL_BRAND 39
352+#define SPELL_ENCHANT_ARMOR 40
353+#define SPELL_ENCHANT_WEAPON 41
354+#define SPELL_ESCAPE_LEVEL 42
355+#define SPELL_ESSENCE_OF_SPEED 43
356+#define SPELL_FIND_TRAPS 44
357+#define SPELL_FIND_TRAPS_DOORS 45
358+#define SPELL_FIRE_BALL 46
359+#define SPELL_FIRE_BOLT 47
360+#define SPELL_FROST_BALL 48
361+#define SPELL_FROST_BOLT 49
362+#define SPELL_GENOCIDE 50 /* GENOCIDE = BANISHMENT = GENOCIDE_I ? */
363+#define SPELL_GLYPH_OF_WARDING 51
364+#define SPELL_HASTE_SELF 52
365+#define SPELL_HEAL 53
366+#define SPELL_HEALING 54
367+#define SPELL_HEAVENS_WRATH 55
368+#define SPELL_HELLFIRE 56
369+#define SPELL_HEROISM 57
370+#define SPELL_HOLY_WORD 58
371+#define SPELL_ICE_STORM 59
372+#define SPELL_IDENTIFY 60
373+#define SPELL_INVULNERABILITY 61
374+#define SPELL_LIGHT_AREA 62
375+#define SPELL_LIGHTNING_BOLT 63
376+#define SPELL_MAGIC_MISSILE 64
377+#define SPELL_MAGIC_REFLECTION 65
378+#define SPELL_MASS_GENOCIDE 66
379+#define SPELL_METEOR_SWARM 67
380+#define SPELL_NEUTRALIZE_POISON 68
381+#define SPELL_OBJECT_DETECTION 69
382+#define SPELL_ORB_OF_DRAINING 70
383+#define SPELL_PERCEPTION 71
384+#define SPELL_PHASE_DOOR 72
385+#define SPELL_POLYMORPH_OTHER 73
386+#define SPELL_PORTAL 74
387+#define SPELL_PRAYER 75
388+#define SPELL_PROBING 76
390389 #define SPELL_PROTECTION_FROM_EVIL 77
391-#define SPELL_RECHARGE_ITEM_I 78
392-#define SPELL_RECHARGE_ITEM_II 79
393-#define SPELL_RECHARGE_ITEM_III 80
394-#define SPELL_RECHARGING 81
395-#define SPELL_REMEMBRANCE 82
396-#define SPELL_REMOVE_CURSE 83
397-#define SPELL_REMOVE_FEAR 84
398-#define SPELL_RESIST_ACID 85
399-#define SPELL_RESIST_COLD 86
400-#define SPELL_RESIST_FIRE 87
401-#define SPELL_RESIST_HEAT_COLD 88
402-#define SPELL_RESIST_POISON 89
403-#define SPELL_RESISTANCE 90
404-#define SPELL_RESTORATION 91
405-#define SPELL_SANCTUARY 92
406-#define SPELL_SATISFY_HUNGER 93
407-#define SPELL_SENSE_EVIL 94
408-#define SPELL_SENSE_INVISIBLE 95
409-#define SPELL_SENSE_MONSTERS 96
390+#define SPELL_RECHARGE_ITEM_I 78
391+#define SPELL_RECHARGE_ITEM_II 79
392+#define SPELL_RECHARGE_ITEM_III 80
393+#define SPELL_RECHARGING 81
394+#define SPELL_REMEMBRANCE 82
395+#define SPELL_REMOVE_CURSE 83
396+#define SPELL_REMOVE_FEAR 84
397+#define SPELL_RESIST_ACID 85
398+#define SPELL_RESIST_COLD 86
399+#define SPELL_RESIST_FIRE 87
400+#define SPELL_RESIST_HEAT_COLD 88
401+#define SPELL_RESIST_POISON 89
402+#define SPELL_RESISTANCE 90
403+#define SPELL_RESTORATION 91
404+#define SPELL_SANCTUARY 92
405+#define SPELL_SATISFY_HUNGER 93
406+#define SPELL_SENSE_EVIL 94
407+#define SPELL_SENSE_INVISIBLE 95
408+#define SPELL_SENSE_MONSTERS 96
410409 #define SPELL_SENSE_SURROUNDINGS 97
411-#define SPELL_SHAKE_GROUND 98
412-#define SPELL_SHIELD 99
413-#define SPELL_SLEEP_I 100
414-#define SPELL_SLEEP_II 101
415-#define SPELL_SLEEP_III 102
416-#define SPELL_SLOW_MONSTER 103
417-#define SPELL_SLOW_POISON 104
418-#define SPELL_SPEAR_OF_LIGHT 105
419-#define SPELL_STAIR_CREATION 106
420-#define SPELL_STINKING_CLOUD 107
421-#define SPELL_TELEPORT 108
422-#define SPELL_TELEPORT_AWAY 109
423-#define SPELL_TELEPORT_LEVEL 110
424-#define SPELL_TELEPORT_OTHER 111
425-#define SPELL_TELEPORT_SELF 112
426-#define SPELL_TERRIFY_CREATURE 113
410+#define SPELL_SHAKE_GROUND 98
411+#define SPELL_SHIELD 99
412+#define SPELL_SLEEP_I 100
413+#define SPELL_SLEEP_II 101
414+#define SPELL_SLEEP_III 102
415+#define SPELL_SLOW_MONSTER 103
416+#define SPELL_SLOW_POISON 104
417+#define SPELL_SPEAR_OF_LIGHT 105
418+#define SPELL_STAIR_CREATION 106
419+#define SPELL_STINKING_CLOUD 107
420+#define SPELL_TELEPORT 108
421+#define SPELL_TELEPORT_AWAY 109
422+#define SPELL_TELEPORT_LEVEL 110
423+#define SPELL_TELEPORT_OTHER 111
424+#define SPELL_TELEPORT_SELF 112
425+#define SPELL_TERRIFY_CREATURE 113
427426 #define SPELL_TRAP_DOOR_DESTRUCTION 114
428427 #define SPELL_TREASURE_DETECTION 115
429-#define SPELL_TURN_STONE_TO_MUD 116
430-#define SPELL_TURN_UNDEAD 117
431-#define SPELL_UNBARRING_WAYS 118
428+#define SPELL_TURN_STONE_TO_MUD 116
429+#define SPELL_TURN_UNDEAD 117
430+#define SPELL_UNBARRING_WAYS 118
432431 #define SPELL_WORD_OF_DESTRUCTION 119
433432 #define SPELL_WORD_OF_RECALL 120
434433
@@ -748,8 +747,10 @@
748747 #define SUMMON_WRAITH 31
749748 #define SUMMON_UNIQUE 32
750749 #define SUMMON_KIN 33
750+/* xxx */
751+#define SUMMON_MONSTER 41
752+#define SUMMON_MONSTERS 42
751753
752-
753754 /*
754755 * Spell types used by project(), and related functions.
755756 */
--- trunk/Angband65/src/config.h (revision 146)
+++ trunk/Angband65/src/config.h (revision 147)
@@ -104,15 +104,6 @@
104104 /* #define ALLOW_TEMPLATES_OUTPUT */
105105
106106
107-/*
108- * OPTION: use "power" rating algorithm to determine prices of wearable
109- * items (weapons, armour, jewelry, light sources, ammo). If this option is
110- * used, only wearable items will be priced this way - consumables will still
111- * use prices from text files.
112- */
113-#define POWER_PRICING
114-
115-
116107 /*** X11 settings ***/
117108
118109 /*
--- trunk/Angband65/src/x-spell.c (revision 146)
+++ trunk/Angband65/src/x-spell.c (revision 147)
@@ -52,8 +52,11 @@
5252 case SPELL_TREASURE_DETECTION:
5353 strnfmt(p, len, " range %dd2+%d", (plev / 2), (plev / 10) + 1);
5454 break;
55- case SPELL_CURE_LIGHT_WOUNDS: /* TODO Check how much healed by CURE_LIGHT_WOUNDS */
56- strnfmt(p, len, " heal 2d8");
55+ case SPELL_CURE_LIGHT_WOUNDS: /* Same as CURE_MINOR_WOUNDS, except harder */
56+ (void)heal_player(15, 15);
57+ (void)dec_timed(TMD_CUT, 20, TRUE);
58+ (void)dec_timed(TMD_CONFUSED, 20, TRUE);
59+ (void)clear_timed(TMD_BLIND, TRUE);
5760 break;
5861 case SPELL_OBJECT_DETECTION:
5962 /* No entry */
@@ -232,8 +235,11 @@
232235 case SPELL_DETECT_EVIL:
233236 /* No entry */
234237 break;
235- case SPELL_CURE_MINOR_WOUNDS: /* TODO Check if cure minor and cure light cure the same amount */
236- strnfmt(p, len, " 2d10");
238+ case SPELL_CURE_MINOR_WOUNDS: /* Same as CURE_LIGHT_WOUNDS (mage), except easier */
239+ (void)heal_player(15, 15);
240+ (void)dec_timed(TMD_CUT, 20, TRUE);
241+ (void)dec_timed(TMD_CONFUSED, 20, TRUE);
242+ (void)clear_timed(TMD_BLIND, TRUE);
237243 break;
238244 case SPELL_BLESS:
239245 my_strcpy(p, " dur 12+d12", len); /* Why is this 'my_strcpy' and the rest 'strnfmt' ? */
@@ -259,9 +265,6 @@
259265 case SPELL_PORTAL:
260266 strnfmt(p, len, " range %d", 3 * plev);
261267 break;
262- case SPELL_CURE_MEDIUM_WOUNDS:
263- my_strcpy(p, " heal 4d10", len);
264- break;
265268 case SPELL_CHANT:
266269 my_strcpy(p, " dur 24+d24", len);
267270 break;
@@ -284,8 +287,8 @@
284287 strnfmt(p, len, " %d+3d6", plev +
285288 (plev / ((cp_ptr->flags & CF_BLESS_WEAPON) ? 2 : 4)));
286289 break;
287- case SPELL_CURE_CRITICAL_WOUNDS:
288- my_strcpy(p, " heal 6d10", len);
290+ case SPELL_CURE_CRIT_WOUNDS:
291+ my_strcpy(p, " heal 25%", len);
289292 break;
290293 case SPELL_SENSE_INVISIBLE:
291294 my_strcpy(p, " dur 24+d24", len);
@@ -299,8 +302,8 @@
299302 case SPELL_SENSE_SURROUNDINGS:
300303 /* No entry */
301304 break;
302- case SPELL_CURE_CRIT_WOUNDS_II: /* Same as CURE_MORTAL_WOUNDS */
303- my_strcpy(p, " heal 8d10", len);
305+ case SPELL_CURE_CRIT_WOUNDS_II: /* Easier to cast? */
306+ my_strcpy(p, " heal 25%", len);
304307 break;
305308 case SPELL_TURN_UNDEAD:
306309 /* No entry */
@@ -312,8 +315,11 @@
312315 strnfmt(p, len, " dam d%d", 3 * plev);
313316 break;
314317 case SPELL_HEAL:
315- my_strcpy(p, " heal 300", len);
318+ my_strcpy(p, " heal 35%", len);
316319 break;
320+ case SPELL_HEALING:
321+ my_strcpy(p, " heal 2000", len);
322+ break;
317323 case SPELL_DISPEL_EVIL:
318324 strnfmt(p, len, " dam d%d", 3 * plev);
319325 break;
@@ -353,15 +359,12 @@
353359 case SPELL_CLAIRVOYANCE:
354360 /* No entry */
355361 break;
356- case SPELL_CURE_SERIOUS_WOUNDS:
357- my_strcpy(p, " heal 4d10", len);
362+ case SPELL_CURE_SER_WOUNDS:
363+ my_strcpy(p, " heal 20%", len);
358364 break;
359- case SPELL_CURE_MORTAL_WOUNDS:
360- my_strcpy(p, " heal 8d10", len);
365+ case SPELL_CURE_SER_WOUNDS_II: /* Easier to cast? */
366+ my_strcpy(p, " heal 20%", len);
361367 break;
362- case SPELL_HEALING:
363- my_strcpy(p, " heal 2000", len);
364- break;
365368 case SPELL_RESTORATION:
366369 /* No entry */
367370 break;
@@ -916,12 +919,6 @@
916919 ((plev < 30) ? 2 : 3));
917920 break;
918921 }
919- case SPELL_CURE_SER_WOUNDS:
920- {
921- hp_player(damroll(6, 10));
922- set_cut(0);
923- break;
924- }
925922 case SPELL_SENSE_INVISIBLE:
926923 {
927924 set_tim_invis(p_ptr->tim_invis + randint(24) + 24);
@@ -1043,7 +1040,7 @@
10431040 wiz_lite();
10441041 break;
10451042 }
1046- case SPELL_CURE_SER_WOUNDS_EASY:
1043+ case SPELL_CURE_SERIOUS_WOUNDS:
10471044 {
10481045 hp_player(damroll(4, 10));
10491046 set_cut(0);
@@ -1585,12 +1582,6 @@
15851582 teleport_player(plev * 3);
15861583 break;
15871584 }
1588- case SPELL_CURE_MEDIUM_WOUNDS: /* Same effect as CURE_SERIOUS_WOUNDS */
1589- {
1590- (void)hp_player(damroll(4, 10));
1591- (void)set_timed(TMD_CUT, (p_ptr->timed[TMD_CUT] / 2) - 20, TRUE);
1592- break;
1593- }
15941585 case SPELL_CHANT:
15951586 {
15961587 (void)inc_timed(TMD_BLESSED, randint1(24) + 24, TRUE);
@@ -1631,12 +1622,15 @@
16311622 ((plev < 30) ? 2 : 3));
16321623 break;
16331624 }
1634- case SPELL_CURE_CRITICAL_WOUNDS:
1625+ case SPELL_CURE_CRIT_WOUNDS:
16351626 {
1636- (void)hp_player(damroll(6, 10));
1637- (void)clear_timed(TMD_CUT, TRUE);
1638- (void)clear_timed(TMD_AMNESIA, TRUE);
1639- break;
1627+ (void)heal_player(25, 30);
1628+ (void)clear_timed(TMD_CUT, TRUE);
1629+ (void)clear_timed(TMD_AMNESIA, TRUE);
1630+ (void)clear_timed(TMD_CONFUSED, TRUE);
1631+ (void)clear_timed(TMD_BLIND, TRUE);
1632+ (void)clear_timed(TMD_POISONED, TRUE);
1633+ (void)clear_timed(TMD_STUN, TRUE);
16401634 }
16411635 case SPELL_SENSE_INVISIBLE:
16421636 {
@@ -1658,11 +1652,15 @@
16581652 map_area();
16591653 break;
16601654 }
1661- case SPELL_CURE_CRIT_WOUNDS_II:
1655+ case SPELL_CURE_CRIT_WOUNDS_II: /* Easier to cast? */
16621656 {
1663- (void)hp_player(damroll(8, 10));
1664- (void)clear_timed(TMD_STUN, TRUE);
1665- (void)clear_timed(TMD_CUT, TRUE);
1657+ (void)heal_player(25, 30);
1658+ (void)clear_timed(TMD_CUT, TRUE);
1659+ (void)clear_timed(TMD_AMNESIA, TRUE);
1660+ (void)clear_timed(TMD_CONFUSED, TRUE);
1661+ (void)clear_timed(TMD_BLIND, TRUE);
1662+ (void)clear_timed(TMD_POISONED, TRUE);
1663+ (void)clear_timed(TMD_STUN, TRUE);
16661664 break;
16671665 }
16681666 case SPELL_TURN_UNDEAD:
@@ -1682,9 +1680,16 @@
16821680 }
16831681 case SPELL_HEAL:
16841682 {
1685- (void)hp_player(300);
1683+ int amt = (p_ptr->mhp * 35) / 100;
1684+ if (amt < 300) amt = 300;
1685+
1686+ (void)hp_player(amt);
16861687 (void)clear_timed(TMD_STUN, TRUE);
16871688 (void)clear_timed(TMD_CUT, TRUE);
1689+ (void)clear_timed(TMD_AMNESIA, TRUE);
1690+ (void)clear_timed(TMD_CONFUSED, TRUE);
1691+ (void)clear_timed(TMD_BLIND, TRUE);
1692+ (void)clear_timed(TMD_POISONED, TRUE);
16881693 break;
16891694 }
16901695 case SPELL_DISPEL_EVIL:
@@ -1758,17 +1763,20 @@
17581763 wiz_lite();
17591764 break;
17601765 }
1761- case SPELL_CURE_SERIOUS_WOUNDS:
1766+ case SPELL_CURE_SER_WOUNDS:
17621767 {
1763- (void)hp_player(damroll(4, 10));
1764- (void)clear_timed(TMD_CUT, TRUE);
1768+ (void)heal_player(20, 25);
1769+ (void)clear_timed(TMD_CUT, TRUE);
1770+ (void)clear_timed(TMD_CONFUSED, TRUE);
1771+ (void)clear_timed(TMD_BLIND, TRUE);
17651772 break;
17661773 }
1767- case SPELL_CURE_MORTAL_WOUNDS:
1774+ case SPELL_CURE_SER_WOUNDS_II: /* Easier to cast? */
17681775 {
1769- (void)hp_player(damroll(8, 10));
1770- (void)clear_timed(TMD_STUN, TRUE);
1771- (void)clear_timed(TMD_CUT, TRUE);
1776+ (void)heal_player(20, 25);
1777+ (void)clear_timed(TMD_CUT, TRUE);
1778+ (void)clear_timed(TMD_CONFUSED, TRUE);
1779+ (void)clear_timed(TMD_BLIND, TRUE);
17721780 break;
17731781 }
17741782 case SPELL_HEALING:
--- trunk/Angband65/src/monster/melee2.c (revision 146)
+++ trunk/Angband65/src/monster/melee2.c (revision 147)
@@ -1937,7 +1937,7 @@
19371937 else msg_format("%^s magically summons help!", m_name);
19381938 for (k = 0; k < 1; k++)
19391939 {
1940- count += summon_specific(m_ptr->fy, m_ptr->fx, rlev, 0);
1940+ count += summon_specific(m_ptr->fy, m_ptr->fx, rlev, SUMMON_MONSTER);
19411941 }
19421942 if (blind && count)
19431943 {
@@ -1954,7 +1954,7 @@
19541954 else msg_format("%^s magically summons monsters!", m_name);
19551955 for (k = 0; k < 8; k++)
19561956 {
1957- count += summon_specific(m_ptr->fy, m_ptr->fx, rlev, 0);
1957+ count += summon_specific(m_ptr->fy, m_ptr->fx, rlev, SUMMON_MONSTER);
19581958 }
19591959 if (blind && count)
19601960 {
--- trunk/Angband65/src/monster/monster2.c (revision 146)
+++ trunk/Angband65/src/monster/monster2.c (revision 147)
@@ -2077,13 +2077,8 @@
20772077
20782078
20792079 /* Hack -- no specific type specified */
2080- if (!summon_specific_type)
2081- {
2082- okay = (!(r_ptr->flags[0] & (RF0_FRIEND)) &&
2083- !(r_ptr->flags[0] & (RF0_FRIENDS)) &&
2084- !(r_ptr->flags[0] & (RF0_ESCORT)));
2085- return (okay);
2086- }
2080+ if (!summon_specific_type)
2081+ return TRUE;
20872082
20882083 /* Check our requirements */
20892084 switch (summon_specific_type)
@@ -2122,7 +2117,8 @@
21222117 !(r_ptr->flags[0] & (RF0_UNIQUE)) &&
21232118 !(r_ptr->flags[0] & (RF0_FRIEND)) &&
21242119 !(r_ptr->flags[0] & (RF0_FRIENDS)) &&
2125- !(r_ptr->flags[0] & (RF0_ESCORT)));
2120+ !(r_ptr->flags[0] & (RF0_ESCORT)) &&
2121+ !(r_ptr->flags[0] & (RF0_ESCORTS)));
21262122 break;
21272123 }
21282124
@@ -2132,7 +2128,8 @@
21322128 !(r_ptr->flags[0] & (RF0_UNIQUE)) &&
21332129 !(r_ptr->flags[0] & (RF0_FRIEND)) &&
21342130 !(r_ptr->flags[0] & (RF0_FRIENDS)) &&
2135- !(r_ptr->flags[0] & (RF0_ESCORT)));
2131+ !(r_ptr->flags[0] & (RF0_ESCORT)) &&
2132+ !(r_ptr->flags[0] & (RF0_ESCORTS)));
21362133 break;
21372134 }
21382135
@@ -2142,7 +2139,8 @@
21422139 !(r_ptr->flags[0] & (RF0_UNIQUE)) &&
21432140 !(r_ptr->flags[0] & (RF0_FRIEND)) &&
21442141 !(r_ptr->flags[0] & (RF0_FRIENDS)) &&
2145- !(r_ptr->flags[0] & (RF0_ESCORT)));
2142+ !(r_ptr->flags[0] & (RF0_ESCORT)) &&
2143+ !(r_ptr->flags[0] & (RF0_ESCORTS)));
21462144 break;
21472145 }
21482146
@@ -2152,7 +2150,8 @@
21522150 !(r_ptr->flags[0] & (RF0_UNIQUE)) &&
21532151 !(r_ptr->flags[0] & (RF0_FRIEND)) &&
21542152 !(r_ptr->flags[0] & (RF0_FRIENDS)) &&
2155- !(r_ptr->flags[0] & (RF0_ESCORT)));
2153+ !(r_ptr->flags[0] & (RF0_ESCORT)) &&
2154+ !(r_ptr->flags[0] & (RF0_ESCORTS)));
21562155 break;
21572156 }
21582157
@@ -2195,6 +2194,20 @@
21952194 okay = (r_ptr->flags[0] & (RF0_UNIQUE)) ? TRUE : FALSE;
21962195 break;
21972196 }
2197+ case SUMMON_MONSTER:
2198+ {
2199+ okay = (!(r_ptr->flags[0] & (RF0_UNIQUE)) &&
2200+ !(r_ptr->flags[0] & (RF0_FRIEND)) &&
2201+ !(r_ptr->flags[0] & (RF0_FRIENDS)) &&
2202+ !(r_ptr->flags[0] & (RF0_ESCORT)) &&
2203+ !(r_ptr->flags[0] & (RF0_ESCORTS)));
2204+ break;
2205+ }
2206+ case SUMMON_MONSTERS:
2207+ {
2208+ okay = (!(r_ptr->flags[0] & (RF0_UNIQUE)));
2209+ break;
2210+ }
21982211 }
21992212
22002213 /* Result */
--- trunk/Angband65/src/tables.c (revision 146)
+++ trunk/Angband65/src/tables.c (revision 147)
@@ -1408,6 +1408,7 @@
14081408 "splendid",
14091409 "excellent",
14101410 "special",
1411+ "unknown"
14111412 };
14121413
14131414 const grouper object_text_order[] =
Show on old repository browser