• R/O
  • SSH
  • HTTPS

angband65: Commit


Commit MetaInfo

Revision149 (tree)
Zeit2009-05-16 22:09:36
Autorpaulblay

Log Message

This closes #15789 Effects (EF_***) details to create and to check (Note that some other, related, tickets remain open).

Ändern Zusammenfassung

Diff

--- trunk/Angband65/src/defines.h (revision 148)
+++ trunk/Angband65/src/defines.h (revision 149)
@@ -227,6 +227,16 @@
227227 #define MAX_I_IDX 800*3 /* Max size for "i_list[]" */
228228
229229 /*
230+ * different types of events that can cause a ball or bolt of something
231+ */
232+#define WHO_PLAYER -1
233+/* TODO Check if other 'who' parameters needed */
234+/* #define WHO_MONSTER 1
235+#define WHO_TRAPBYPLAYER 3
236+#define WHO_TRAPBYMONSTER 4
237+#define WHO_PLAYERASWIZARD 5 */
238+
239+/*
230240 * Hack -- first "normal" artifact in the artifact list. All of
231241 * the artifacts with indexes from 2 to 20 are "special" (lights,
232242 * rings, amulets), and the ones from 21 to 126 are "normal".
@@ -777,7 +787,7 @@
777787 #define GF_XXX2 21
778788 #define GF_LITE 22
779789 #define GF_DARK 23
780-#define GF_XXX3 24
790+#define GF_CONF_STRONG 24
781791 #define GF_CONFUSION 25
782792 #define GF_SOUND 26
783793 #define GF_SHARD 27
--- trunk/Angband65/src/list-effects.h (revision 148)
+++ trunk/Angband65/src/list-effects.h (revision 149)
@@ -280,10 +280,6 @@
280280 EFFECT(CREATE_TREASURE, FALSE, 0, "creates treasure right in front of you.")
281281 /* See also Vanilla Angband History */
282282 EFFECT(DETECT_OBJECT, FALSE, 0, "lets you know if there are any objects in the dungeon around you.")
283-/* See also Vanilla Angband History */
284-EFFECT(GENOCIDE, FALSE, 0, "lets you wipe one race in this dungeon level, at a cost of up to 10% of monster level in hitpoints per monster.")
285-/* See also Vanilla Angband History */
286-EFFECT(GENOCIDE2, FALSE, 0, "lets you kill all monsters surrounding you, at a cost of up to 2 times your player level per monster.")
287283
288284 /* TODO Check aim is required */
289285 EFFECT(IDENTIFY_TRAP, TRUE, 0, "This rod will identify one trap-type for you, making it much easier to avoid it the next time.")
--- trunk/Angband65/src/externs.h (revision 148)
+++ trunk/Angband65/src/externs.h (revision 149)
@@ -507,6 +507,7 @@
507507 extern bool detect_traps(bool aware);
508508 extern bool detect_doorstairs(bool aware);
509509 extern bool detect_treasure(bool aware);
510+extern bool detect_gold(bool aware);
510511 extern bool detect_objects(bool aware);
511512 extern bool detect_objects_magic(bool aware);
512513 extern bool detect_monsters_normal(bool aware);
--- trunk/Angband65/src/spells1.c (revision 148)
+++ trunk/Angband65/src/spells1.c (revision 149)
@@ -369,6 +369,7 @@
369369 case GF_DISENCHANT: return (TERM_VIOLET);
370370 case GF_NEXUS: return (TERM_L_RED);
371371 case GF_CONFUSION: return (TERM_L_UMBER);
372+ case GF_CONF_STRONG: return (TERM_L_UMBER); /* TODO Diff color for strong? */
372373 case GF_SOUND: return (TERM_YELLOW);
373374 case GF_SHARD: return (TERM_UMBER);
374375 case GF_FORCE: return (TERM_UMBER);
@@ -2396,6 +2397,25 @@
23962397 break;
23972398 }
23982399
2400+ /* Confusion */
2401+ case GF_CONF_STRONG:
2402+ {
2403+ if (seen) obvious = TRUE;
2404+ do_conf = (50 + randint1(75) + r) / (r + 1);
2405+ if (r_ptr->spell_flags[0] & (RSF0_BR_CONF))
2406+ {
2407+ note = " resists.";
2408+ dam *= 2; dam /= (randint1(6)+6);
2409+ }
2410+ else if (r_ptr->flags[2] & (RF2_NO_CONF))
2411+ {
2412+ note = " resists somewhat.";
2413+ dam /= 2;
2414+ }
2415+ break;
2416+ }
2417+
2418+
23992419 /* Disenchantment */
24002420 case GF_DISENCHANT:
24012421 {
@@ -3624,6 +3644,8 @@
36243644 break;
36253645 }
36263646
3647+/* case GF_CONF_STRONG: */ /* No monster can cast strong conf */
3648+
36273649 /* Disenchantment -- see above */
36283650 case GF_DISENCHANT:
36293651 {
--- trunk/Angband65/src/effects.c (revision 148)
+++ trunk/Angband65/src/effects.c (revision 149)
@@ -184,10 +184,14 @@
184184 *ident = TRUE;
185185 return TRUE;
186186 }
187- case EF_DETECT_OBJECT:
188- case EF_GENOCIDE:
189- case EF_GENOCIDE2:
190- case EF_CONF_STRONG: /* See code under ART_SARUMAN in /64 */
187+ case EF_CONF_STRONG: /* Was ART_SARUMAN in /64 */
188+ {
189+ int flg = PROJECT_KILL; /* TODO Check this is the only flag needed */
190+ ISBYTE(px);
191+ ISBYTE(py);
192+ project(WHO_PLAYER, 2+randint1(2), (byte) py, (byte) px, 0, GF_CONF_STRONG, flg);
193+ return TRUE;
194+ }
191195 case EF_SUN_HERO: /* ART_SUN in /64 */
192196 {
193197 (void)lite_area(damroll(20, 10), 8);
@@ -196,7 +200,17 @@
196200 return TRUE;
197201 }
198202 case EF_IDENTIFY_TRAP:
203+ {
204+/*
205+ * TODO Get this to work. Also note that rod_charge stuff should
206+ * probably not be done in the EF_ bit
207+ */
208+#if 0
209+ if (ident_trap(dir)) ident = TRUE;
210+ o_ptr->p1val += get_rod_charge(o_ptr);
211+#endif
199212 return TRUE;
213+ }
200214 /* End of those added for Angband/65 */
201215
202216 case EF_POISON: /* POTION_POISON */
@@ -789,19 +803,21 @@
789803 if (inc_timed(TMD_OPP_POIS, randint1(20) + 20, TRUE)) *ident = TRUE;
790804 return TRUE;
791805 }
792-
793- case EF_DETECT_TREASURE:
806+ case EF_DETECT_TREASURE: /* In /64 only detects gold, not objects */
794807 {
795- if (detect_treasure(aware)) *ident = TRUE;
808+ if (detect_gold(aware)) *ident = TRUE;
796809 return TRUE;
797810 }
798-
811+ case EF_DETECT_OBJECT:
812+ {
813+ if (detect_objects(aware)) *ident = TRUE;
814+ return TRUE;
815+ }
799816 case EF_DETECT_TRAP:
800817 {
801818 if (detect_traps(aware)) *ident = TRUE;
802819 return TRUE;
803820 }
804-
805821 case EF_DETECT_DOORSTAIR:
806822 {
807823 if (detect_doorstairs(aware)) *ident = TRUE;
@@ -1015,7 +1031,7 @@
10151031 return TRUE;
10161032 }
10171033
1018- case EF_BANISHMENT:
1034+ case EF_BANISHMENT: /* AKA GENOCIDE */
10191035 {
10201036 *ident = TRUE;
10211037 if (!banishment()) return FALSE;
@@ -1623,7 +1639,7 @@
16231639 return TRUE;
16241640 }
16251641
1626- case EF_FAST_BERSERK:
1642+ case EF_FAST_BERSERK: /* TODO Check this works */
16271643 {
16281644 if (inc_timed(TMD_SHERO, randint1(50) + 50, TRUE)) *ident = TRUE;
16291645 if (!p_ptr->timed[TMD_FAST])
@@ -1636,7 +1652,7 @@
16361652 (void)inc_timed(TMD_FAST, 5, TRUE);
16371653 }
16381654 hp_player(30);
1639- (void)clear_timed(TMD_AFRAID, TRUE); /* Possibly not required - immune to fear while hero? */
1655+ (void)clear_timed(TMD_AFRAID, TRUE);
16401656
16411657 return TRUE;
16421658 }
--- trunk/Angband65/src/cmd5.c (revision 148)
+++ trunk/Angband65/src/cmd5.c (revision 149)
@@ -1041,7 +1041,6 @@
10411041 (void)Term_load();
10421042 }
10431043
1044-
10451044 #if 0
10461045 /*
10471046 * View the detailed description for a selected spell.
--- trunk/Angband65/src/monster/melee2.c (revision 148)
+++ trunk/Angband65/src/monster/melee2.c (revision 149)
@@ -995,7 +995,7 @@
995995 break;
996996 }
997997
998- case SPELL(0,RSF0_BR_CONF):
998+ case SPELL(0,RSF0_BR_CONF): /* Note, no monster can breath strong conf */
999999 {
10001000 disturb(1, 0);
10011001 sound(MSG_BR_CONF);
--- trunk/Angband65/src/spells2.c (revision 148)
+++ trunk/Angband65/src/spells2.c (revision 149)
@@ -1179,7 +1179,99 @@
11791179 return gold_buried || objects;
11801180 }
11811181
1182+/*
1183+ * Detect gold around the player.
1184+ */
1185+bool detect_gold(bool aware)
1186+{
1187+ int i;
1188+ int y, x;
1189+ int x1, x2, y1, y2;
11821190
1191+ bool gold = FALSE;
1192+
1193+ /* Pick an area to map */
1194+ y1 = p_ptr->py - DETECT_DIST_Y;
1195+ y2 = p_ptr->py + DETECT_DIST_Y;
1196+ x1 = p_ptr->px - DETECT_DIST_X;
1197+ x2 = p_ptr->px + DETECT_DIST_X;
1198+
1199+ if (y1 < 0) y1 = 0;
1200+ if (x1 < 0) x1 = 0;
1201+
1202+
1203+ /* Scan the dungeon */
1204+ for (y = y1; y < y2; y++)
1205+ {
1206+ for (x = x1; x < x2; x++)
1207+ {
1208+ if (!in_bounds_fully(y, x)) continue;
1209+
1210+ /* Notice embedded gold */
1211+ if ((cave_feat[y][x] == FEAT_MAGMA_H) ||
1212+ (cave_feat[y][x] == FEAT_QUARTZ_H))
1213+ {
1214+ /* Expose the gold */
1215+ cave_feat[y][x] += 0x02;
1216+ }
1217+
1218+ /* Magma/Quartz + Known Gold */
1219+ if ((cave_feat[y][x] == FEAT_MAGMA_K) ||
1220+ (cave_feat[y][x] == FEAT_QUARTZ_K))
1221+ {
1222+ /* Hack -- Memorize */
1223+ cave_info[y][x] |= (CAVE_MARK);
1224+
1225+ /* Redraw */
1226+ lite_spot(y, x);
1227+
1228+ /* Detect */
1229+ gold = TRUE;
1230+ }
1231+ }
1232+ }
1233+
1234+ /* Scan objects */
1235+ for (i = 1; i < o_max; i++)
1236+ {
1237+ object_type *o_ptr = &o_list[i];
1238+
1239+ /* Skip dead objects */
1240+ if (!o_ptr->k_idx) continue;
1241+
1242+ /* Skip held objects */
1243+ if (o_ptr->held_m_idx) continue;
1244+
1245+ /* Skip anything that isn't gold */
1246+ if (o_ptr->tval != TV_GOLD)
1247+ continue;
1248+
1249+ /* Location */
1250+ y = o_ptr->iy;
1251+ x = o_ptr->ix;
1252+
1253+ /* Only detect nearby objects */
1254+ if (x < x1 || y < y1 || x > x2 || y > y2) continue;
1255+
1256+ /* Hack -- memorize it */
1257+ o_ptr->marked = TRUE;
1258+
1259+ /* Redraw */
1260+ lite_spot(y, x);
1261+
1262+ /* Detect */
1263+ gold = TRUE;
1264+ }
1265+
1266+ if (gold)
1267+ msg_print("You sense the presence of buried treasure!");
1268+
1269+ if (aware && !gold)
1270+ msg_print("You sense no treasure.");
1271+
1272+ return gold;
1273+}
1274+
11831275 /*
11841276 * Detect objects around the player.
11851277 */
@@ -2063,7 +2155,7 @@
20632155 if (!player_has_los_bold(y, x)) continue;
20642156
20652157 /* Jump directly to the target monster */
2066- if (project(-1, 0, y, x, dam, typ, flg)) obvious = TRUE;
2158+ if (project(WHO_PLAYER, 0, y, x, dam, typ, flg)) obvious = TRUE;
20672159 }
20682160
20692161 /* Result */
@@ -3103,7 +3195,7 @@
31033195 }
31043196
31053197 /* Hook into the "project()" function */
3106- (void)project(-1, rad, py, px, dam, GF_LITE_WEAK, flg);
3198+ (void)project(WHO_PLAYER, rad, py, px, dam, GF_LITE_WEAK, flg);
31073199
31083200 /* Lite up the room */
31093201 lite_room(py, px);
@@ -3172,7 +3264,7 @@
31723264 }
31733265
31743266 /* Analyze the "dir" and the "target". Hurt items on floor. */
3175- return (project(-1, rad, ty, tx, dam, typ, flg));
3267+ return (project(WHO_PLAYER, rad, ty, tx, dam, typ, flg));
31763268 }
31773269
31783270
@@ -3206,7 +3298,7 @@
32063298 while (num--)
32073299 {
32083300 /* Analyze the "dir" and the "target". Hurt items on floor. */
3209- if (project(-1, rad, ty, tx, dam, typ, flg)) noticed = TRUE;
3301+ if (project(WHO_PLAYER, rad, ty, tx, dam, typ, flg)) noticed = TRUE;
32103302 }
32113303
32123304 return noticed;
@@ -3237,7 +3329,7 @@
32373329 target_get(&tx, &ty);
32383330
32393331 /* Analyze the "dir" and the "target", do NOT explode */
3240- return (project(-1, 0, ty, tx, dam, typ, flg));
3332+ return (project(WHO_PLAYER, 0, ty, tx, dam, typ, flg));
32413333 }
32423334
32433335
@@ -3385,7 +3477,7 @@
33853477 byte px = p_ptr->px;
33863478
33873479 int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
3388- return (project(-1, 1, py, px, 0, GF_MAKE_DOOR, flg));
3480+ return (project(WHO_PLAYER, 1, py, px, 0, GF_MAKE_DOOR, flg));
33893481 }
33903482
33913483 bool trap_creation(void)
@@ -3394,7 +3486,7 @@
33943486 byte px = p_ptr->px;
33953487
33963488 int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
3397- return (project(-1, 1, py, px, 0, GF_MAKE_TRAP, flg));
3489+ return (project(WHO_PLAYER, 1, py, px, 0, GF_MAKE_TRAP, flg));
33983490 }
33993491
34003492 bool destroy_doors_touch(void)
@@ -3403,7 +3495,7 @@
34033495 byte px = p_ptr->px;
34043496
34053497 int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
3406- return (project(-1, 1, py, px, 0, GF_KILL_DOOR, flg));
3498+ return (project(WHO_PLAYER, 1, py, px, 0, GF_KILL_DOOR, flg));
34073499 }
34083500
34093501 bool sleep_monsters_touch(void)
@@ -3412,7 +3504,7 @@
34123504 byte px = p_ptr->px;
34133505
34143506 int flg = PROJECT_KILL | PROJECT_HIDE;
3415- return (project(-1, 1, py, px, p_ptr->lev, GF_OLD_SLEEP, flg));
3507+ return (project(WHO_PLAYER, 1, py, px, p_ptr->lev, GF_OLD_SLEEP, flg));
34163508 }
34173509
34183510
--- trunk/Angband65/lib/edit/object.txt (revision 148)
+++ trunk/Angband65/lib/edit/object.txt (revision 149)
@@ -1304,14 +1304,6 @@
13041304 # A:<locale>5/<chance>1
13051305 D:The spell will heal up to 2d8 hitpoints, and try to heal cuts as well.
13061306
1307-N:125:Cure Medium Wounds
1308-# F:CURE_MEDIUM_WOUNDS
1309-G:?:b
1310-I:71:21:0:0
1311-W:40:0:5:0
1312-# A:<locale>10/<chance>1
1313-D:This spell will heal medium wounds and cuts.
1314-
13151307 N:126:Cure Minor Wounds
13161308 # F:CURE_MINOR_WOUNDS
13171309 G:?:b
@@ -1329,21 +1321,20 @@
13291321 D:The spell will let you purge yourself of poisonous residues.
13301322
13311323 N:128:Cure Serious wounds I
1332-# F:CURE_SERIOUS_WOUNDS
1324+# F:CURE_SER_WOUNDS
13331325 G:?:b
13341326 I:71:24:0:0
1335-W:40:0:5:0
1327+W:20:0:5:0
13361328 # A:<locale>20/<chance>1
13371329 D:This spell will heal serious wounds and cuts.
13381330
1339-#book Purifications and Healing - about 60/1
1340-N:129:Cure Serious Wounds II
1341-# F:CURE_SERIOUS_WOUNDS_II
1331+N:129:Cure Serious wounds II
1332+# F:CURE_SER_WOUNDS_II
13421333 G:?:b
13431334 I:71:25:0:0
13441335 W:40:0:5:0
1345-# A:<locale>60/<chance>1
1346-D:This spell will cure serious wounds and cuts in an easy way.
1336+# A:<locale>40/<chance>1
1337+D:This spell will heal serious wounds and cuts.
13471338
13481339 N:130:Detect Doors Stairs
13491340 # F:DETECT_DOORS_STAIRS
@@ -2564,7 +2555,7 @@
25642555 # A:<locale>40/<chance>4
25652556 D:It will let you wipe one race in this dungeon level, at a cost of up to 10% of
25662557 D:monster level in hitpoints per monster.
2567-E:GENOCIDE
2558+E:BANISHMENT
25682559 F:EASY_KNOW
25692560
25702561 N:265:Mass Genocide
@@ -2574,7 +2565,7 @@
25742565 # A:<locale>50/<chance>4
25752566 D:It will let you kill all monsters surrounding you, at a cost of up to 2
25762567 D:times your player level per monster.
2577-E:GENOCIDE2
2568+E:LOSKILL
25782569 F:EASY_KNOW
25792570
25802571 N:266:Acquirement
@@ -3631,7 +3622,7 @@
36313622 P:0:1d2:0:0:0
36323623 D:This staff will let you wipe one race in this dungeon level, at a cost of up to 10% of
36333624 D:monster level in hitpoints per monster.
3634-E:GENOCIDE
3625+E:BANISHMENT
36353626 C:2d2
36363627 F:EASY_KNOW
36373628
--- trunk/Angband65/lib/edit/ego_item.txt (revision 148)
+++ trunk/Angband65/lib/edit/ego_item.txt (revision 149)
@@ -327,7 +327,6 @@
327327 W:0:2:100:0
328328 F:STR1 | DEX1 | CON1
329329
330-# What does activation do ?
331330 N:31:of the Noldor
332331 T:32:0:99
333332 T:33:0:99
@@ -336,6 +335,7 @@
336335 M:0:0:0:1:0
337336 W:0:2:100:900
338337 F:DEX1 | SUST_DEX | ACTIVATE
338+# E:DETECT_TREASURE:10+d20
339339
340340 ### Cloaks ###
341341
@@ -487,12 +487,12 @@
487487 M:0:0:0:-1:0
488488 F:STEALTH1
489489
490-# What does activation do ?
491490 N:50:of Jumping
492491 T:30:0:99
493492 X:7:0
494493 W:0:2:100:500
495494 F:HIDE_TYPE | ACTIVATE
495+# E:TELE_PHASE:10+d10
496496
497497 N:51:of Noise
498498 T:30:0:99
--- trunk/Angband65/lib/edit/artifact.txt (revision 148)
+++ trunk/Angband65/lib/edit/artifact.txt (revision 149)
@@ -344,7 +344,7 @@
344344 W:40:3:250:150000
345345 P:35:2d4:-3:0:25
346346 F:STR1 | CHR1 | HIDE_TYPE | RES_ACID | RES_ELEC | RES_FIRE | RES_COLD | RES_DARK | RES_DISEN | ACTIVATE
347-A:GENOCIDE:400+4d50
347+A:BANISHMENT:400+4d50
348348 M:Your {kind} glow{s} deep blue...
349349 D:A shimmering suit of true-silver, forged long ago by dwarven smiths of
350350 D: legend. It gleams with purest white as you gaze upon it, and mighty are
@@ -1311,6 +1311,7 @@
13111311 F:CHR1 | INT2 | WIS2 | HIDE_TYPE | ACTIVATE
13121312 A:CONF_STRONG:100+d100
13131313 M:The {kind} emits a humming sound that tears at your soul...
1314+D:The quarterstaff of Saruman lends persuasive force to its wielder and can be activated to cause great confusion in those nearby.
13141315
13151316 ### BOWS ###
13161317
Show on old repository browser