1 /* Purpose: Artifact code */
4 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
6 * This software may be copied and distributed for educational, research, and
7 * not for profit purposes provided that this copyright and statement are
8 * included in all such copies.
14 /* Chance of using syllables to form the name instead of the "template" files */
22 * Bias luck needs to be higher than weird luck,
23 * since it is usually tested several times...
25 #define ACTIVATION_CHANCE 3
28 static void curse_artifact(object_type * o_ptr)
30 if (o_ptr->pval > 0) o_ptr->pval = 0 - (o_ptr->pval + randint1(4));
31 if (o_ptr->to_a > 0) o_ptr->to_a = 0 - (o_ptr->to_a + randint1(4));
32 if (o_ptr->to_h > 0) o_ptr->to_h = 0 - (o_ptr->to_h + randint1(4));
33 if (o_ptr->to_d > 0) o_ptr->to_d = 0 - (o_ptr->to_d + randint1(4));
35 o_ptr->art_flags3 |= (TR3_HEAVY_CURSE | TR3_CURSED);
37 if (one_in_(4)) o_ptr->art_flags3 |= TR3_PERMA_CURSE;
38 if (one_in_(3)) o_ptr->art_flags3 |= TR3_TY_CURSE;
39 if (one_in_(2)) o_ptr->art_flags3 |= TR3_AGGRAVATE;
40 if (one_in_(3)) o_ptr->art_flags3 |= TR3_DRAIN_EXP;
41 if (one_in_(2)) o_ptr->art_flags3 |= TR3_TELEPORT;
42 else if (one_in_(3)) o_ptr->art_flags3 |= TR3_NO_TELE;
44 if ((p_ptr->pclass != CLASS_WARRIOR) && (p_ptr->pclass != CLASS_ARCHER) && (p_ptr->pclass != CLASS_CAVALRY) && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH) && one_in_(3))
45 o_ptr->art_flags3 |= TR3_NO_MAGIC;
47 o_ptr->ident |= IDENT_CURSED;
51 static void random_plus(object_type * o_ptr, bool is_scroll)
53 int this_type = (o_ptr->tval < TV_BOOTS ? 23 : 19);
55 if (artifact_bias == BIAS_WARRIOR)
57 if (!(o_ptr->art_flags1 & TR1_STR))
59 o_ptr->art_flags1 |= TR1_STR;
60 if (one_in_(2)) return; /* 50% chance of being a "free" power */
63 if (!(o_ptr->art_flags1 & TR1_CON))
65 o_ptr->art_flags1 |= TR1_CON;
66 if (one_in_(2)) return;
69 if (!(o_ptr->art_flags1 & TR1_DEX))
71 o_ptr->art_flags1 |= TR1_DEX;
72 if (one_in_(2)) return;
75 else if (artifact_bias == BIAS_MAGE)
77 if (!(o_ptr->art_flags1 & TR1_INT))
79 o_ptr->art_flags1 |= TR1_INT;
80 if (one_in_(2)) return;
82 if ((o_ptr->tval == TV_GLOVES) && !(o_ptr->art_flags1 & TR1_MAGIC_MASTERY))
84 o_ptr->art_flags1 |= TR1_MAGIC_MASTERY;
85 if (one_in_(2)) return;
88 else if (artifact_bias == BIAS_PRIESTLY)
90 if (!(o_ptr->art_flags1 & TR1_WIS))
92 o_ptr->art_flags1 |= TR1_WIS;
93 if (one_in_(2)) return;
96 else if (artifact_bias == BIAS_RANGER)
98 if (!(o_ptr->art_flags1 & TR1_DEX))
100 o_ptr->art_flags1 |= TR1_DEX;
101 if (one_in_(2)) return;
104 if (!(o_ptr->art_flags1 & TR1_CON))
106 o_ptr->art_flags1 |= TR1_CON;
107 if (one_in_(2)) return; /* 50% chance of being a "free" power */
110 if (!(o_ptr->art_flags1 & TR1_STR))
112 o_ptr->art_flags1 |= TR1_STR;
113 if (one_in_(2)) return;
116 else if (artifact_bias == BIAS_ROGUE)
118 if (!(o_ptr->art_flags1 & TR1_STEALTH))
120 o_ptr->art_flags1 |= TR1_STEALTH;
121 if (one_in_(2)) return;
123 if (!(o_ptr->art_flags1 & TR1_SEARCH))
125 o_ptr->art_flags1 |= TR1_SEARCH;
126 if (one_in_(2)) return;
129 else if (artifact_bias == BIAS_STR)
131 if (!(o_ptr->art_flags1 & TR1_STR))
133 o_ptr->art_flags1 |= TR1_STR;
134 if (one_in_(2)) return;
137 else if (artifact_bias == BIAS_WIS)
139 if (!(o_ptr->art_flags1 & TR1_WIS))
141 o_ptr->art_flags1 |= TR1_WIS;
142 if (one_in_(2)) return;
145 else if (artifact_bias == BIAS_INT)
147 if (!(o_ptr->art_flags1 & TR1_INT))
149 o_ptr->art_flags1 |= TR1_INT;
150 if (one_in_(2)) return;
153 else if (artifact_bias == BIAS_DEX)
155 if (!(o_ptr->art_flags1 & TR1_DEX))
157 o_ptr->art_flags1 |= TR1_DEX;
158 if (one_in_(2)) return;
161 else if (artifact_bias == BIAS_CON)
163 if (!(o_ptr->art_flags1 & TR1_CON))
165 o_ptr->art_flags1 |= TR1_CON;
166 if (one_in_(2)) return;
169 else if (artifact_bias == BIAS_CHR)
171 if (!(o_ptr->art_flags1 & TR1_CHR))
173 o_ptr->art_flags1 |= TR1_CHR;
174 if (one_in_(2)) return;
178 if ((artifact_bias == BIAS_MAGE || artifact_bias == BIAS_PRIESTLY) && (o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ROBE))
180 if (!(o_ptr->art_flags3 & TR3_DEC_MANA) && one_in_(3))
182 o_ptr->art_flags3 |= TR3_DEC_MANA;
183 if (one_in_(2)) return;
187 switch (randint1(this_type))
190 o_ptr->art_flags1 |= TR1_STR;
191 if (!artifact_bias && !one_in_(13))
192 artifact_bias = BIAS_STR;
193 else if (!artifact_bias && one_in_(7))
194 artifact_bias = BIAS_WARRIOR;
197 o_ptr->art_flags1 |= TR1_INT;
198 if (!artifact_bias && !one_in_(13))
199 artifact_bias = BIAS_INT;
200 else if (!artifact_bias && one_in_(7))
201 artifact_bias = BIAS_MAGE;
204 o_ptr->art_flags1 |= TR1_WIS;
205 if (!artifact_bias && !one_in_(13))
206 artifact_bias = BIAS_WIS;
207 else if (!artifact_bias && one_in_(7))
208 artifact_bias = BIAS_PRIESTLY;
211 o_ptr->art_flags1 |= TR1_DEX;
212 if (!artifact_bias && !one_in_(13))
213 artifact_bias = BIAS_DEX;
214 else if (!artifact_bias && one_in_(7))
215 artifact_bias = BIAS_ROGUE;
218 o_ptr->art_flags1 |= TR1_CON;
219 if (!artifact_bias && !one_in_(13))
220 artifact_bias = BIAS_CON;
221 else if (!artifact_bias && one_in_(9))
222 artifact_bias = BIAS_RANGER;
225 o_ptr->art_flags1 |= TR1_CHR;
226 if (!artifact_bias && !one_in_(13))
227 artifact_bias = BIAS_CHR;
230 o_ptr->art_flags1 |= TR1_STEALTH;
231 if (!artifact_bias && one_in_(3))
232 artifact_bias = BIAS_ROGUE;
235 o_ptr->art_flags1 |= TR1_SEARCH;
236 if (!artifact_bias && one_in_(9))
237 artifact_bias = BIAS_RANGER;
240 o_ptr->art_flags1 |= TR1_INFRA;
243 o_ptr->art_flags1 |= TR1_SPEED;
244 if (!artifact_bias && one_in_(11))
245 artifact_bias = BIAS_ROGUE;
248 o_ptr->art_flags1 |= TR1_TUNNEL;
251 if (o_ptr->tval == TV_BOW) random_plus(o_ptr, is_scroll);
254 o_ptr->art_flags1 |= TR1_BLOWS;
255 if (!artifact_bias && one_in_(11))
256 artifact_bias = BIAS_WARRIOR;
263 void random_resistance(object_type * o_ptr, bool is_scroll, int specific)
265 if (!specific) /* To avoid a number of possible bugs */
267 if (artifact_bias == BIAS_ACID)
269 if (!(o_ptr->art_flags2 & TR2_RES_ACID))
271 o_ptr->art_flags2 |= TR2_RES_ACID;
272 if (one_in_(2)) return;
274 if (one_in_(BIAS_LUCK) && !(o_ptr->art_flags2 & TR2_IM_ACID))
276 o_ptr->art_flags2 |= TR2_IM_ACID;
277 if (!one_in_(IM_LUCK)) o_ptr->art_flags2 &= ~(TR2_IM_ELEC | TR2_IM_COLD | TR2_IM_FIRE);
278 if (one_in_(2)) return;
281 else if (artifact_bias == BIAS_ELEC)
283 if (!(o_ptr->art_flags2 & TR2_RES_ELEC))
285 o_ptr->art_flags2 |= TR2_RES_ELEC;
286 if (one_in_(2)) return;
288 if ((o_ptr->tval >= TV_CLOAK) && (o_ptr->tval <= TV_HARD_ARMOR) &&
289 !(o_ptr->art_flags3 & TR3_SH_ELEC))
291 o_ptr->art_flags3 |= TR3_SH_ELEC;
292 if (one_in_(2)) return;
294 if (one_in_(BIAS_LUCK) && !(o_ptr->art_flags2 & TR2_IM_ELEC))
296 o_ptr->art_flags2 |= TR2_IM_ELEC;
297 if (!one_in_(IM_LUCK)) o_ptr->art_flags2 &= ~(TR2_IM_ACID | TR2_IM_COLD | TR2_IM_FIRE);
298 if (one_in_(2)) return;
301 else if (artifact_bias == BIAS_FIRE)
303 if (!(o_ptr->art_flags2 & TR2_RES_FIRE))
305 o_ptr->art_flags2 |= TR2_RES_FIRE;
306 if (one_in_(2)) return;
308 if ((o_ptr->tval >= TV_CLOAK) &&
309 (o_ptr->tval <= TV_HARD_ARMOR) &&
310 !(o_ptr->art_flags3 & TR3_SH_FIRE))
312 o_ptr->art_flags3 |= TR3_SH_FIRE;
313 if (one_in_(2)) return;
315 if (one_in_(BIAS_LUCK) &&
316 !(o_ptr->art_flags2 & TR2_IM_FIRE))
318 o_ptr->art_flags2 |= TR2_IM_FIRE;
319 if (!one_in_(IM_LUCK)) o_ptr->art_flags2 &= ~(TR2_IM_ELEC | TR2_IM_COLD | TR2_IM_ACID);
320 if (one_in_(2)) return;
323 else if (artifact_bias == BIAS_COLD)
325 if (!(o_ptr->art_flags2 & TR2_RES_COLD))
327 o_ptr->art_flags2 |= TR2_RES_COLD;
328 if (one_in_(2)) return;
330 if ((o_ptr->tval >= TV_CLOAK) &&
331 (o_ptr->tval <= TV_HARD_ARMOR) &&
332 !(o_ptr->art_flags3 & TR3_SH_COLD))
334 o_ptr->art_flags3 |= TR3_SH_COLD;
335 if (one_in_(2)) return;
337 if (one_in_(BIAS_LUCK) && !(o_ptr->art_flags2 & TR2_IM_COLD))
339 o_ptr->art_flags2 |= TR2_IM_COLD;
340 if (!one_in_(IM_LUCK)) o_ptr->art_flags2 &= ~(TR2_IM_ELEC | TR2_IM_ACID | TR2_IM_FIRE);
341 if (one_in_(2)) return;
344 else if (artifact_bias == BIAS_POIS)
346 if (!(o_ptr->art_flags2 & TR2_RES_POIS))
348 o_ptr->art_flags2 |= TR2_RES_POIS;
349 if (one_in_(2)) return;
352 else if (artifact_bias == BIAS_WARRIOR)
354 if (!one_in_(3) && (!(o_ptr->art_flags2 & TR2_RES_FEAR)))
356 o_ptr->art_flags2 |= TR2_RES_FEAR;
357 if (one_in_(2)) return;
359 if (one_in_(3) && (!(o_ptr->art_flags3 & TR3_NO_MAGIC)))
361 o_ptr->art_flags3 |= TR3_NO_MAGIC;
362 if (one_in_(2)) return;
365 else if (artifact_bias == BIAS_NECROMANTIC)
367 if (!(o_ptr->art_flags2 & TR2_RES_NETHER))
369 o_ptr->art_flags2 |= TR2_RES_NETHER;
370 if (one_in_(2)) return;
372 if (!(o_ptr->art_flags2 & TR2_RES_POIS))
374 o_ptr->art_flags2 |= TR2_RES_POIS;
375 if (one_in_(2)) return;
377 if (!(o_ptr->art_flags2 & TR2_RES_DARK))
379 o_ptr->art_flags2 |= TR2_RES_DARK;
380 if (one_in_(2)) return;
383 else if (artifact_bias == BIAS_CHAOS)
385 if (!(o_ptr->art_flags2 & TR2_RES_CHAOS))
387 o_ptr->art_flags2 |= TR2_RES_CHAOS;
388 if (one_in_(2)) return;
390 if (!(o_ptr->art_flags2 & TR2_RES_CONF))
392 o_ptr->art_flags2 |= TR2_RES_CONF;
393 if (one_in_(2)) return;
395 if (!(o_ptr->art_flags2 & TR2_RES_DISEN))
397 o_ptr->art_flags2 |= TR2_RES_DISEN;
398 if (one_in_(2)) return;
403 switch (specific ? specific : randint1(42))
406 if (!one_in_(WEIRD_LUCK))
407 random_resistance(o_ptr, is_scroll, specific);
410 o_ptr->art_flags2 |= TR2_IM_ACID;
412 artifact_bias = BIAS_ACID;
416 if (!one_in_(WEIRD_LUCK))
417 random_resistance(o_ptr, is_scroll, specific);
420 o_ptr->art_flags2 |= TR2_IM_ELEC;
422 artifact_bias = BIAS_ELEC;
426 if (!one_in_(WEIRD_LUCK))
427 random_resistance(o_ptr, is_scroll, specific);
430 o_ptr->art_flags2 |= TR2_IM_COLD;
432 artifact_bias = BIAS_COLD;
436 if (!one_in_(WEIRD_LUCK))
437 random_resistance(o_ptr, is_scroll, specific);
440 o_ptr->art_flags2 |= TR2_IM_FIRE;
442 artifact_bias = BIAS_FIRE;
448 o_ptr->art_flags2 |= TR2_RES_ACID;
450 artifact_bias = BIAS_ACID;
455 o_ptr->art_flags2 |= TR2_RES_ELEC;
457 artifact_bias = BIAS_ELEC;
462 o_ptr->art_flags2 |= TR2_RES_FIRE;
464 artifact_bias = BIAS_FIRE;
469 o_ptr->art_flags2 |= TR2_RES_COLD;
471 artifact_bias = BIAS_COLD;
475 o_ptr->art_flags2 |= TR2_RES_POIS;
476 if (!artifact_bias && !one_in_(4))
477 artifact_bias = BIAS_POIS;
478 else if (!artifact_bias && one_in_(2))
479 artifact_bias = BIAS_NECROMANTIC;
480 else if (!artifact_bias && one_in_(2))
481 artifact_bias = BIAS_ROGUE;
485 o_ptr->art_flags2 |= TR2_RES_FEAR;
486 if (!artifact_bias && one_in_(3))
487 artifact_bias = BIAS_WARRIOR;
490 o_ptr->art_flags2 |= TR2_RES_LITE;
493 o_ptr->art_flags2 |= TR2_RES_DARK;
497 o_ptr->art_flags2 |= TR2_RES_BLIND;
501 o_ptr->art_flags2 |= TR2_RES_CONF;
502 if (!artifact_bias && one_in_(6))
503 artifact_bias = BIAS_CHAOS;
507 o_ptr->art_flags2 |= TR2_RES_SOUND;
511 o_ptr->art_flags2 |= TR2_RES_SHARDS;
515 o_ptr->art_flags2 |= TR2_RES_NETHER;
516 if (!artifact_bias && one_in_(3))
517 artifact_bias = BIAS_NECROMANTIC;
521 o_ptr->art_flags2 |= TR2_RES_NEXUS;
525 o_ptr->art_flags2 |= TR2_RES_CHAOS;
526 if (!artifact_bias && one_in_(2))
527 artifact_bias = BIAS_CHAOS;
531 o_ptr->art_flags2 |= TR2_RES_DISEN;
534 if (o_ptr->tval >= TV_CLOAK && o_ptr->tval <= TV_HARD_ARMOR)
535 o_ptr->art_flags3 |= TR3_SH_ELEC;
537 random_resistance(o_ptr, is_scroll, specific);
539 artifact_bias = BIAS_ELEC;
542 if (o_ptr->tval >= TV_CLOAK && o_ptr->tval <= TV_HARD_ARMOR)
543 o_ptr->art_flags3 |= TR3_SH_FIRE;
545 random_resistance(o_ptr, is_scroll, specific);
547 artifact_bias = BIAS_FIRE;
550 if (o_ptr->tval == TV_SHIELD || o_ptr->tval == TV_CLOAK ||
551 o_ptr->tval == TV_HELM || o_ptr->tval == TV_HARD_ARMOR)
552 o_ptr->art_flags2 |= TR2_REFLECT;
554 random_resistance(o_ptr, is_scroll, specific);
557 if (o_ptr->tval >= TV_CLOAK && o_ptr->tval <= TV_HARD_ARMOR)
558 o_ptr->art_flags3 |= TR3_SH_COLD;
560 random_resistance(o_ptr, is_scroll, specific);
562 artifact_bias = BIAS_COLD;
569 static void random_misc(object_type * o_ptr, bool is_scroll)
571 if (artifact_bias == BIAS_RANGER)
573 if (!(o_ptr->art_flags2 & TR2_SUST_CON))
575 o_ptr->art_flags2 |= TR2_SUST_CON;
576 if (one_in_(2)) return;
579 else if (artifact_bias == BIAS_STR)
581 if (!(o_ptr->art_flags2 & TR2_SUST_STR))
583 o_ptr->art_flags2 |= TR2_SUST_STR;
584 if (one_in_(2)) return;
587 else if (artifact_bias == BIAS_WIS)
589 if (!(o_ptr->art_flags2 & TR2_SUST_WIS))
591 o_ptr->art_flags2 |= TR2_SUST_WIS;
592 if (one_in_(2)) return;
595 else if (artifact_bias == BIAS_INT)
597 if (!(o_ptr->art_flags2 & TR2_SUST_INT))
599 o_ptr->art_flags2 |= TR2_SUST_INT;
600 if (one_in_(2)) return;
603 else if (artifact_bias == BIAS_DEX)
605 if (!(o_ptr->art_flags2 & TR2_SUST_DEX))
607 o_ptr->art_flags2 |= TR2_SUST_DEX;
608 if (one_in_(2)) return;
611 else if (artifact_bias == BIAS_CON)
613 if (!(o_ptr->art_flags2 & TR2_SUST_CON))
615 o_ptr->art_flags2 |= TR2_SUST_CON;
616 if (one_in_(2)) return;
619 else if (artifact_bias == BIAS_CHR)
621 if (!(o_ptr->art_flags2 & TR2_SUST_CHR))
623 o_ptr->art_flags2 |= TR2_SUST_CHR;
624 if (one_in_(2)) return;
627 else if (artifact_bias == BIAS_CHAOS)
629 if (!(o_ptr->art_flags3 & TR3_TELEPORT))
631 o_ptr->art_flags3 |= TR3_TELEPORT;
632 if (one_in_(2)) return;
635 else if (artifact_bias == BIAS_FIRE)
637 if (!(o_ptr->art_flags3 & TR3_LITE))
639 o_ptr->art_flags3 |= TR3_LITE; /* Freebie */
643 switch (randint1(31))
646 o_ptr->art_flags2 |= TR2_SUST_STR;
648 artifact_bias = BIAS_STR;
651 o_ptr->art_flags2 |= TR2_SUST_INT;
653 artifact_bias = BIAS_INT;
656 o_ptr->art_flags2 |= TR2_SUST_WIS;
658 artifact_bias = BIAS_WIS;
661 o_ptr->art_flags2 |= TR2_SUST_DEX;
663 artifact_bias = BIAS_DEX;
666 o_ptr->art_flags2 |= TR2_SUST_CON;
668 artifact_bias = BIAS_CON;
671 o_ptr->art_flags2 |= TR2_SUST_CHR;
673 artifact_bias = BIAS_CHR;
678 o_ptr->art_flags2 |= TR2_FREE_ACT;
681 o_ptr->art_flags2 |= TR2_HOLD_LIFE;
682 if (!artifact_bias && one_in_(5))
683 artifact_bias = BIAS_PRIESTLY;
684 else if (!artifact_bias && one_in_(6))
685 artifact_bias = BIAS_NECROMANTIC;
689 o_ptr->art_flags3 |= TR3_LITE;
693 o_ptr->art_flags3 |= TR3_FEATHER;
698 o_ptr->art_flags3 |= TR3_SEE_INVIS;
701 if (one_in_(3)) break;
702 o_ptr->art_flags3 |= TR3_TELEPATHY;
703 if (!artifact_bias && one_in_(9))
704 artifact_bias = BIAS_MAGE;
708 o_ptr->art_flags3 |= TR3_SLOW_DIGEST;
712 o_ptr->art_flags3 |= TR3_REGEN;
715 o_ptr->art_flags3 |= TR3_TELEPORT;
720 if (o_ptr->tval >= TV_BOOTS && o_ptr->tval <= TV_DRAG_ARMOR)
721 random_misc(o_ptr, is_scroll);
724 o_ptr->to_a = 4 + randint1(11);
731 int bonus_h, bonus_d;
732 o_ptr->art_flags3 |= TR3_SHOW_MODS;
733 bonus_h = 4 + (randint1(11));
734 bonus_d = 4 + (randint1(11));
735 if ((o_ptr->tval != TV_SWORD) && (o_ptr->tval != TV_POLEARM) && (o_ptr->tval != TV_HAFTED) && (o_ptr->tval != TV_DIGGING) && (o_ptr->tval != TV_GLOVES) && (o_ptr->tval != TV_RING))
740 o_ptr->to_h += bonus_h;
741 o_ptr->to_d += bonus_d;
745 o_ptr->art_flags3 |= TR3_NO_MAGIC;
748 o_ptr->art_flags3 |= TR3_NO_TELE;
754 static void random_slay(object_type *o_ptr, bool is_scroll)
756 if (artifact_bias == BIAS_CHAOS && (o_ptr->tval != TV_BOW))
758 if (!(o_ptr->art_flags1 & TR1_CHAOTIC))
760 o_ptr->art_flags1 |= TR1_CHAOTIC;
761 if (one_in_(2)) return;
765 else if (artifact_bias == BIAS_PRIESTLY &&
766 (o_ptr->tval == TV_SWORD || o_ptr->tval == TV_POLEARM) &&
767 !(o_ptr->art_flags3 & TR3_BLESSED))
769 /* A free power for "priestly" random artifacts */
770 o_ptr->art_flags3 |= TR3_BLESSED;
773 else if (artifact_bias == BIAS_NECROMANTIC && (o_ptr->tval != TV_BOW))
775 if (!(o_ptr->art_flags1 & TR1_VAMPIRIC))
777 o_ptr->art_flags1 |= TR1_VAMPIRIC;
778 if (one_in_(2)) return;
780 if (!(o_ptr->art_flags1 & TR1_BRAND_POIS) && one_in_(2))
782 o_ptr->art_flags1 |= TR1_BRAND_POIS;
783 if (one_in_(2)) return;
787 else if (artifact_bias == BIAS_RANGER && (o_ptr->tval != TV_BOW))
789 if (!(o_ptr->art_flags1 & TR1_SLAY_ANIMAL))
791 o_ptr->art_flags1 |= TR1_SLAY_ANIMAL;
792 if (one_in_(2)) return;
796 else if (artifact_bias == BIAS_ROGUE && (o_ptr->tval != TV_BOW))
798 if ((((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DAGGER)) ||
799 ((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_SPEAR))) &&
800 !(o_ptr->art_flags2 & TR2_THROW))
802 /* Free power for rogues... */
803 o_ptr->art_flags2 |= TR2_THROW;
805 if (!(o_ptr->art_flags1 & TR1_BRAND_POIS))
807 o_ptr->art_flags1 |= TR1_BRAND_POIS;
808 if (one_in_(2)) return;
812 else if (artifact_bias == BIAS_POIS && (o_ptr->tval != TV_BOW))
814 if (!(o_ptr->art_flags1 & TR1_BRAND_POIS))
816 o_ptr->art_flags1 |= TR1_BRAND_POIS;
817 if (one_in_(2)) return;
821 else if (artifact_bias == BIAS_FIRE && (o_ptr->tval != TV_BOW))
823 if (!(o_ptr->art_flags1 & TR1_BRAND_FIRE))
825 o_ptr->art_flags1 |= TR1_BRAND_FIRE;
826 if (one_in_(2)) return;
830 else if (artifact_bias == BIAS_COLD && (o_ptr->tval != TV_BOW))
832 if (!(o_ptr->art_flags1 & TR1_BRAND_COLD))
834 o_ptr->art_flags1 |= TR1_BRAND_COLD;
835 if (one_in_(2)) return;
839 else if (artifact_bias == BIAS_ELEC && (o_ptr->tval != TV_BOW))
841 if (!(o_ptr->art_flags1 & TR1_BRAND_ELEC))
843 o_ptr->art_flags1 |= TR1_BRAND_ELEC;
844 if (one_in_(2)) return;
848 else if (artifact_bias == BIAS_ACID && (o_ptr->tval != TV_BOW))
850 if (!(o_ptr->art_flags1 & TR1_BRAND_ACID))
852 o_ptr->art_flags1 |= TR1_BRAND_ACID;
853 if (one_in_(2)) return;
857 else if (artifact_bias == BIAS_LAW && (o_ptr->tval != TV_BOW))
859 if (!(o_ptr->art_flags1 & TR1_SLAY_EVIL))
861 o_ptr->art_flags1 |= TR1_SLAY_EVIL;
862 if (one_in_(2)) return;
864 if (!(o_ptr->art_flags1 & TR1_SLAY_UNDEAD))
866 o_ptr->art_flags1 |= TR1_SLAY_UNDEAD;
867 if (one_in_(2)) return;
869 if (!(o_ptr->art_flags1 & TR1_SLAY_DEMON))
871 o_ptr->art_flags1 |= TR1_SLAY_DEMON;
872 if (one_in_(2)) return;
876 if (o_ptr->tval != TV_BOW)
878 switch (randint1(34))
882 o_ptr->art_flags1 |= TR1_SLAY_ANIMAL;
886 o_ptr->art_flags1 |= TR1_SLAY_EVIL;
887 if (!artifact_bias && one_in_(2))
888 artifact_bias = BIAS_LAW;
889 else if (!artifact_bias && one_in_(9))
890 artifact_bias = BIAS_PRIESTLY;
894 o_ptr->art_flags1 |= TR1_SLAY_UNDEAD;
895 if (!artifact_bias && one_in_(9))
896 artifact_bias = BIAS_PRIESTLY;
900 o_ptr->art_flags1 |= TR1_SLAY_DEMON;
901 if (!artifact_bias && one_in_(9))
902 artifact_bias = BIAS_PRIESTLY;
906 o_ptr->art_flags1 |= TR1_SLAY_ORC;
910 o_ptr->art_flags1 |= TR1_SLAY_TROLL;
914 o_ptr->art_flags1 |= TR1_SLAY_GIANT;
918 o_ptr->art_flags1 |= TR1_SLAY_DRAGON;
921 o_ptr->art_flags1 |= TR1_KILL_DRAGON;
925 if (o_ptr->tval == TV_SWORD)
927 o_ptr->art_flags1 |= TR1_VORPAL;
928 if (!artifact_bias && one_in_(9))
929 artifact_bias = BIAS_WARRIOR;
932 random_slay(o_ptr, is_scroll);
935 o_ptr->art_flags1 |= TR1_IMPACT;
939 o_ptr->art_flags1 |= TR1_BRAND_FIRE;
941 artifact_bias = BIAS_FIRE;
945 o_ptr->art_flags1 |= TR1_BRAND_COLD;
947 artifact_bias = BIAS_COLD;
951 o_ptr->art_flags1 |= TR1_BRAND_ELEC;
953 artifact_bias = BIAS_ELEC;
957 o_ptr->art_flags1 |= TR1_BRAND_ACID;
959 artifact_bias = BIAS_ACID;
963 o_ptr->art_flags1 |= TR1_BRAND_POIS;
964 if (!artifact_bias && !one_in_(3))
965 artifact_bias = BIAS_POIS;
966 else if (!artifact_bias && one_in_(6))
967 artifact_bias = BIAS_NECROMANTIC;
968 else if (!artifact_bias)
969 artifact_bias = BIAS_ROGUE;
972 o_ptr->art_flags1 |= TR1_VAMPIRIC;
974 artifact_bias = BIAS_NECROMANTIC;
977 o_ptr->art_flags1 |= TR1_FORCE_WEAPON;
979 artifact_bias = (one_in_(2) ? BIAS_MAGE : BIAS_PRIESTLY);
982 o_ptr->art_flags1 |= TR1_CHAOTIC;
984 artifact_bias = BIAS_CHAOS;
995 o_ptr->art_flags3 |= TR3_XTRA_MIGHT;
996 if (!one_in_(7)) o_ptr->art_flags3 &= ~(TR3_XTRA_SHOTS);
997 if (!artifact_bias && one_in_(9))
998 artifact_bias = BIAS_RANGER;
1001 o_ptr->art_flags3 |= TR3_XTRA_SHOTS;
1002 if (!one_in_(7)) o_ptr->art_flags3 &= ~(TR3_XTRA_MIGHT);
1003 if (!artifact_bias && one_in_(9))
1004 artifact_bias = BIAS_RANGER;
1011 static void give_activation_power(object_type *o_ptr)
1013 int type = 0, chance = 0;
1017 if (artifact_bias == BIAS_ELEC)
1021 type = ACT_BO_ELEC_1;
1023 else if (!one_in_(5))
1025 type = ACT_BA_ELEC_2;
1029 type = ACT_BA_ELEC_3;
1033 else if (artifact_bias == BIAS_POIS)
1035 type = ACT_BA_POIS_1;
1038 else if (artifact_bias == BIAS_FIRE)
1042 type = ACT_BO_FIRE_1;
1044 else if (!one_in_(5))
1046 type = ACT_BA_FIRE_1;
1050 type = ACT_BA_FIRE_2;
1054 else if (artifact_bias == BIAS_COLD)
1058 type = ACT_BO_COLD_1;
1059 else if (!one_in_(3))
1060 type = ACT_BA_COLD_1;
1061 else if (!one_in_(3))
1062 type = ACT_BA_COLD_2;
1064 type = ACT_BA_COLD_3;
1066 else if (artifact_bias == BIAS_CHAOS)
1070 type = ACT_SUMMON_DEMON;
1072 type = ACT_CALL_CHAOS;
1074 else if (artifact_bias == BIAS_PRIESTLY)
1079 type = ACT_CHARM_UNDEAD;
1080 else if (one_in_(12))
1081 type = ACT_BANISH_EVIL;
1082 else if (one_in_(11))
1083 type = ACT_DISP_EVIL;
1084 else if (one_in_(10))
1085 type = ACT_PROT_EVIL;
1086 else if (one_in_(9))
1087 type = ACT_CURE_1000;
1088 else if (one_in_(8))
1089 type = ACT_CURE_700;
1090 else if (one_in_(7))
1091 type = ACT_REST_ALL;
1092 else if (one_in_(6))
1093 type = ACT_REST_LIFE;
1097 else if (artifact_bias == BIAS_NECROMANTIC)
1102 else if (one_in_(13))
1103 type = ACT_DISP_GOOD;
1104 else if (one_in_(9))
1105 type = ACT_MASS_GENO;
1106 else if (one_in_(8))
1107 type = ACT_GENOCIDE;
1108 else if (one_in_(13))
1109 type = ACT_SUMMON_UNDEAD;
1110 else if (one_in_(9))
1111 type = ACT_VAMPIRE_2;
1112 else if (one_in_(6))
1113 type = ACT_CHARM_UNDEAD;
1115 type = ACT_VAMPIRE_1;
1117 else if (artifact_bias == BIAS_LAW)
1121 type = ACT_BANISH_EVIL;
1122 else if (one_in_(4))
1123 type = ACT_DISP_EVIL;
1125 type = ACT_PROT_EVIL;
1127 else if (artifact_bias == BIAS_ROGUE)
1132 else if (one_in_(4))
1134 else if (one_in_(3))
1135 type = ACT_DETECT_ALL;
1136 else if (one_in_(8))
1139 type = ACT_ID_PLAIN;
1141 else if (artifact_bias == BIAS_MAGE)
1145 type = ACT_SUMMON_ELEMENTAL;
1146 else if (one_in_(10))
1147 type = ACT_SUMMON_PHANTOM;
1148 else if (one_in_(5))
1149 type = ACT_RUNE_EXPLO;
1153 else if (artifact_bias == BIAS_WARRIOR)
1161 else if (artifact_bias == BIAS_RANGER)
1165 type = ACT_CHARM_ANIMALS;
1166 else if (one_in_(7))
1167 type = ACT_SUMMON_ANIMAL;
1168 else if (one_in_(6))
1169 type = ACT_CHARM_ANIMAL;
1170 else if (one_in_(4))
1171 type = ACT_RESIST_ALL;
1172 else if (one_in_(3))
1175 type = ACT_CURE_POISON;
1179 while (!type || (randint1(100) >= chance))
1181 type = randint1(255);
1196 case ACT_CURE_POISON:
1210 case ACT_RESIST_ALL:
1211 case ACT_DETECT_ALL:
1233 case ACT_CHARM_ANIMAL:
1236 case ACT_SUMMON_ANIMAL:
1242 case ACT_BANISH_EVIL:
1245 case ACT_CHARM_UNDEAD:
1246 case ACT_CHARM_OTHER:
1247 case ACT_SUMMON_PHANTOM:
1249 case ACT_RUNE_EXPLO:
1252 case ACT_CALL_CHAOS:
1254 case ACT_CHARM_ANIMALS:
1255 case ACT_CHARM_OTHERS:
1256 case ACT_SUMMON_ELEMENTAL:
1264 case ACT_XTRA_SPEED:
1265 case ACT_DETECT_XTRA:
1269 case ACT_SUMMON_UNDEAD:
1270 case ACT_SUMMON_DEMON:
1281 /* A type was chosen... */
1282 o_ptr->xtra2 = type;
1283 o_ptr->art_flags3 |= TR3_ACTIVATE;
1288 static void get_random_name(char *return_name, bool armour, int power)
1290 if (randint1(100) <= TABLE_NAME)
1292 get_table_name(return_name);
1305 filename = "a_cursed_j.txt";
1307 filename = "a_cursed.txt";
1313 filename = "a_low_j.txt";
1315 filename = "a_low.txt";
1321 filename = "a_med_j.txt";
1323 filename = "a_med.txt";
1329 filename = "a_high_j.txt";
1331 filename = "a_high.txt";
1341 filename = "w_cursed_j.txt";
1343 filename = "w_cursed.txt";
1349 filename = "w_low_j.txt";
1351 filename = "w_low.txt";
1357 filename = "w_med_j.txt";
1359 filename = "w_med.txt";
1365 filename = "w_high_j.txt";
1367 filename = "w_high.txt";
1373 (void)get_rnd_line(filename, artifact_bias, return_name);
1375 if(return_name[0]==0)get_table_name(return_name);
1381 bool create_artifact(object_type *o_ptr, bool a_scroll)
1383 char new_name[1024];
1385 int powers = randint1(5) + 1;
1386 int max_type = (o_ptr->tval < TV_BOOTS ? 7 : 5);
1389 bool a_cursed = FALSE;
1390 int warrior_artifact_bias = 0;
1395 /* Nuke enchantments */
1399 o_ptr->art_flags1 |= k_info[o_ptr->k_idx].flags1;
1400 o_ptr->art_flags2 |= k_info[o_ptr->k_idx].flags2;
1401 o_ptr->art_flags3 |= k_info[o_ptr->k_idx].flags3;
1402 if (o_ptr->pval) has_pval = TRUE;
1404 if (a_scroll && one_in_(4))
1406 switch (p_ptr->pclass)
1409 case CLASS_BERSERKER:
1414 artifact_bias = BIAS_WARRIOR;
1417 case CLASS_HIGH_MAGE:
1418 case CLASS_SORCERER:
1419 case CLASS_MAGIC_EATER:
1420 case CLASS_BLUE_MAGE:
1421 artifact_bias = BIAS_MAGE;
1424 artifact_bias = BIAS_PRIESTLY;
1428 artifact_bias = BIAS_ROGUE;
1429 warrior_artifact_bias = 25;
1432 artifact_bias = BIAS_RANGER;
1433 warrior_artifact_bias = 30;
1436 artifact_bias = BIAS_PRIESTLY;
1437 warrior_artifact_bias = 40;
1439 case CLASS_WARRIOR_MAGE:
1440 case CLASS_RED_MAGE:
1441 artifact_bias = BIAS_MAGE;
1442 warrior_artifact_bias = 40;
1444 case CLASS_CHAOS_WARRIOR:
1445 artifact_bias = BIAS_CHAOS;
1446 warrior_artifact_bias = 40;
1449 case CLASS_FORCETRAINER:
1450 artifact_bias = BIAS_PRIESTLY;
1452 case CLASS_MINDCRAFTER:
1454 if (randint1(5) > 2) artifact_bias = BIAS_PRIESTLY;
1457 if (randint1(5) > 2) artifact_bias = BIAS_WARRIOR;
1459 case CLASS_IMITATOR:
1460 if (randint1(2) > 1) artifact_bias = BIAS_RANGER;
1462 case CLASS_BEASTMASTER:
1463 artifact_bias = BIAS_CHR;
1464 warrior_artifact_bias = 50;
1466 case CLASS_MIRROR_MASTER:
1467 if (randint1(4) > 1)
1469 artifact_bias = BIAS_MAGE;
1473 artifact_bias = BIAS_ROGUE;
1479 if (a_scroll && (randint1(100) <= warrior_artifact_bias))
1480 artifact_bias = BIAS_WARRIOR;
1482 strcpy(new_name, "");
1484 if (!a_scroll && one_in_(A_CURSED))
1486 if (((o_ptr->tval == TV_AMULET) || (o_ptr->tval == TV_RING)) && cursed_p(o_ptr))
1489 while (one_in_(powers) || one_in_(7) || one_in_(10))
1492 if (!a_cursed && one_in_(WEIRD_LUCK))
1495 if (a_cursed) powers /= 2;
1500 switch (randint1(max_type))
1503 random_plus(o_ptr, a_scroll);
1507 if (one_in_(2) && (o_ptr->tval < TV_BOOTS) && (o_ptr->tval != TV_BOW))
1509 if (a_cursed && !one_in_(13)) break;
1512 if (one_in_(o_ptr->ds+4)) o_ptr->ds++;
1516 if (one_in_(o_ptr->dd+1)) o_ptr->dd++;
1520 random_resistance(o_ptr, a_scroll, FALSE);
1523 random_misc(o_ptr, a_scroll);
1526 random_slay(o_ptr, a_scroll);
1529 if (wizard) msg_print("Switch error in create_artifact!");
1537 o_ptr->art_flags3 |= TR3_SHOW_MODS;
1539 /* This one commented out by gw's request... */
1541 o_ptr->art_flags3 |= TR3_HIDE_TYPE;
1544 if (o_ptr->art_flags1 & TR1_BLOWS)
1546 o_ptr->pval = randint1(2);
1547 if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_HAYABUSA))
1556 while (o_ptr->pval < randint1(5) || one_in_(o_ptr->pval));
1559 if ((o_ptr->pval > 4) && !one_in_(WEIRD_LUCK))
1563 /* give it some plusses... */
1564 if (o_ptr->tval >= TV_BOOTS && o_ptr->tval <= TV_DRAG_ARMOR)
1565 o_ptr->to_a += randint1(o_ptr->to_a > 19 ? 1 : 20 - o_ptr->to_a);
1566 else if (o_ptr->tval <= TV_SWORD)
1568 o_ptr->to_h += randint1(o_ptr->to_h > 19 ? 1 : 20 - o_ptr->to_h);
1569 o_ptr->to_d += randint1(o_ptr->to_d > 19 ? 1 : 20 - o_ptr->to_d);
1570 if ((o_ptr->art_flags1 & TR1_WIS) && (o_ptr->pval > 0)) o_ptr->art_flags3 |= TR3_BLESSED;
1573 /* Just to be sure */
1574 o_ptr->art_flags3 |= (TR3_IGNORE_ACID | TR3_IGNORE_ELEC |
1575 TR3_IGNORE_FIRE | TR3_IGNORE_COLD);
1577 total_flags = flag_cost(o_ptr, o_ptr->pval);
1578 if (cheat_peek) msg_format("%ld", total_flags);
1580 if (a_cursed) curse_artifact(o_ptr);
1583 (randint1((o_ptr->tval >= TV_BOOTS)
1584 ? ACTIVATION_CHANCE * 2 : ACTIVATION_CHANCE) == 1))
1587 give_activation_power(o_ptr);
1590 if ((o_ptr->tval >= TV_BOOTS) && (o_ptr->tval <= TV_DRAG_ARMOR))
1592 while ((o_ptr->to_d+o_ptr->to_h) > 20)
1594 if (one_in_(o_ptr->to_d) && one_in_(o_ptr->to_h)) break;
1595 o_ptr->to_d -= (s16b)randint0(3);
1596 o_ptr->to_h -= (s16b)randint0(3);
1598 while ((o_ptr->to_d+o_ptr->to_h) > 10)
1600 if (one_in_(o_ptr->to_d) || one_in_(o_ptr->to_h)) break;
1601 o_ptr->to_d -= (s16b)randint0(3);
1602 o_ptr->to_h -= (s16b)randint0(3);
1606 if (((artifact_bias == BIAS_MAGE) || (artifact_bias == BIAS_INT)) && (o_ptr->tval == TV_GLOVES)) o_ptr->art_flags2 |= TR2_FREE_ACT;
1608 if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI))
1612 o_ptr->art_flags1 &= ~(TR1_BLOWS);
1613 o_ptr->art_flags1 &= ~(TR1_FORCE_WEAPON);
1614 o_ptr->art_flags1 &= ~(TR1_SLAY_ANIMAL);
1615 o_ptr->art_flags1 &= ~(TR1_SLAY_EVIL);
1616 o_ptr->art_flags1 &= ~(TR1_SLAY_UNDEAD);
1617 o_ptr->art_flags1 &= ~(TR1_SLAY_DEMON);
1618 o_ptr->art_flags1 &= ~(TR1_SLAY_ORC);
1619 o_ptr->art_flags1 &= ~(TR1_SLAY_TROLL);
1620 o_ptr->art_flags1 &= ~(TR1_SLAY_GIANT);
1621 o_ptr->art_flags1 &= ~(TR1_SLAY_DRAGON);
1622 o_ptr->art_flags1 &= ~(TR1_KILL_DRAGON);
1623 o_ptr->art_flags1 &= ~(TR1_VORPAL);
1624 o_ptr->art_flags1 &= ~(TR1_BRAND_POIS);
1625 o_ptr->art_flags1 &= ~(TR1_BRAND_ACID);
1626 o_ptr->art_flags1 &= ~(TR1_BRAND_ELEC);
1627 o_ptr->art_flags1 &= ~(TR1_BRAND_FIRE);
1628 o_ptr->art_flags1 &= ~(TR1_BRAND_COLD);
1631 if (o_ptr->tval >= TV_BOOTS)
1633 if (a_cursed) power_level = 0;
1634 else if (total_flags < 15000) power_level = 1;
1635 else if (total_flags < 25000) power_level = 2;
1636 else power_level = 3;
1641 if (a_cursed) power_level = 0;
1642 else if (total_flags < 20000) power_level = 1;
1643 else if (total_flags < 35000) power_level = 2;
1644 else power_level = 3;
1649 char dummy_name[80];
1650 /* Identify it fully */
1651 object_aware(o_ptr);
1652 object_known(o_ptr);
1654 /* Mark the item as fully known */
1655 o_ptr->ident |= (IDENT_MENTAL);
1657 strcpy(dummy_name, "");
1658 (void)identify_fully_aux(o_ptr);
1661 if (!(get_string("¤³¤Î¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È¤ò²¿¤È̾ÉÕ¤±¤Þ¤¹¤«¡©", dummy_name, 80)))
1663 if (!(get_string("What do you want to call the artifact? ", dummy_name, 80)))
1667 get_random_name(new_name, (bool)(o_ptr->tval >= TV_BOOTS), power_level);
1672 strcpy(new_name, "¡Ô");
1674 strcpy(new_name, "'");
1677 strcat(new_name, dummy_name);
1679 strcat(new_name, "¡Õ¤È¤¤¤¦Ì¾¤Î");
1681 strcat(new_name, "'");
1686 chg_virtue(V_INDIVIDUALISM, 2);
1687 chg_virtue(V_ENCHANT, 5);
1692 get_random_name(new_name, (bool)(o_ptr->tval >= TV_BOOTS), power_level);
1699 msg_format("±¿¤ÎÊФä¿¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È: %d¡£", artifact_bias);
1701 msg_format("Biased artifact: %d.", artifact_bias);
1706 msg_print("¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È¤Ë±¿¤ÎÊФê¤Ê¤·¡£");
1708 msg_print("No bias in artifact.");
1713 /* Save the inscription */
1714 o_ptr->art_name = quark_add(new_name);
1717 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1723 bool activate_random_artifact(object_type * o_ptr)
1725 int plev = p_ptr->lev;
1726 int k, dir, dummy = 0;
1728 if (!o_ptr->art_name) return FALSE; /* oops? */
1730 /* Activate for attack */
1731 switch (o_ptr->xtra2)
1735 if (!get_aim_dir(&dir)) return FALSE;
1737 msg_print("ÂÀÍÛ¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
1739 msg_print("A line of sunlight appears.");
1742 (void)lite_line(dir);
1743 o_ptr->timeout = 10;
1750 msg_print("¤½¤ì¤ÏâÁ¤·¤¤¤¯¤é¤¤¤ËÌÀ¤ë¤¯µ±¤¤¤Æ¤¤¤ë...");
1752 msg_print("It glows extremely brightly...");
1755 if (!get_aim_dir(&dir)) return FALSE;
1756 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
1764 msg_print("¤½¤ì¤ÏÇ»Î理Ë̮ư¤·¤Æ¤¤¤ë...");
1766 msg_print("It throbs deep green...");
1769 if (!get_aim_dir(&dir)) return FALSE;
1770 fire_ball(GF_POIS, dir, 12, 3);
1771 o_ptr->timeout = randint0(4) + 4;
1778 msg_print("¤½¤ì¤Ï²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
1780 msg_print("It is covered in sparks...");
1783 if (!get_aim_dir(&dir)) return FALSE;
1784 fire_bolt(GF_ELEC, dir, damroll(4, 8));
1785 o_ptr->timeout = randint0(5) + 5;
1792 msg_print("¤½¤ì¤Ï»À¤Ëʤ¤ï¤ì¤¿...");
1794 msg_print("It is covered in acid...");
1797 if (!get_aim_dir(&dir)) return FALSE;
1798 fire_bolt(GF_ACID, dir, damroll(5, 8));
1799 o_ptr->timeout = randint0(6) + 6;
1806 msg_print("¤½¤ì¤ÏÁú¤Ëʤ¤ï¤ì¤¿...");
1808 msg_print("It is covered in frost...");
1811 if (!get_aim_dir(&dir)) return FALSE;
1812 fire_bolt(GF_COLD, dir, damroll(6, 8));
1813 o_ptr->timeout = randint0(7) + 7;
1820 msg_print("¤½¤ì¤Ï±ê¤Ëʤ¤ï¤ì¤¿...");
1822 msg_print("It is covered in fire...");
1825 if (!get_aim_dir(&dir)) return FALSE;
1826 fire_bolt(GF_FIRE, dir, damroll(9, 8));
1827 o_ptr->timeout = randint0(8) + 8;
1834 msg_print("¤½¤ì¤ÏÁú¤Ëʤ¤ï¤ì¤¿...");
1836 msg_print("It is covered in frost...");
1839 if (!get_aim_dir(&dir)) return FALSE;
1840 fire_ball(GF_COLD, dir, 48, 2);
1841 o_ptr->timeout = 400;
1848 msg_print("¤½¤ì¤ÏÀÖ¤¯·ã¤·¤¯µ±¤¤¤¿...");
1850 msg_print("It glows an intense red...");
1853 if (!get_aim_dir(&dir)) return FALSE;
1854 fire_ball(GF_FIRE, dir, 72, 2);
1855 o_ptr->timeout = 400;
1862 msg_print("¤½¤ì¤Ï¹õ¤¯µ±¤¤¤¿...");
1864 msg_print("It glows black...");
1867 if (!get_aim_dir(&dir)) return FALSE;
1868 if (drain_life(dir, 100))
1869 o_ptr->timeout = randint0(100) + 100;
1876 msg_print("¤½¤ì¤ÏÀĤ¯·ã¤·¤¯µ±¤¤¤¿...");
1878 msg_print("It glows an intense blue...");
1881 if (!get_aim_dir(&dir)) return FALSE;
1882 fire_ball(GF_COLD, dir, 100, 2);
1883 o_ptr->timeout = 300;
1890 msg_print("Åŵ¤¤¬¥Ñ¥Á¥Ñ¥Á²»¤òΩ¤Æ¤¿...");
1892 msg_print("It crackles with electricity...");
1895 if (!get_aim_dir(&dir)) return FALSE;
1896 fire_ball(GF_ELEC, dir, 100, 3);
1897 o_ptr->timeout = 500;
1904 msg_print("¹õ¤¯µ±¤¤¤Æ¤¤¤ë...");
1906 msg_print("It glows black...");
1909 if (!get_aim_dir(&dir)) return FALSE;
1910 drain_life(dir, 120);
1911 o_ptr->timeout = 400;
1917 if (!get_aim_dir(&dir)) return FALSE;
1918 for (dummy = 0; dummy < 3; dummy++)
1920 if (drain_life(dir, 50))
1923 o_ptr->timeout = 400;
1930 msg_print("ËâË¡¤Î¥È¥²¤¬¸½¤ì¤¿...");
1932 msg_print("It grows magical spikes...");
1935 if (!get_aim_dir(&dir)) return FALSE;
1936 fire_bolt(GF_ARROW, dir, 150);
1937 o_ptr->timeout = randint0(90) + 90;
1944 msg_print("¿¼ÀÖ¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
1946 msg_print("It glows deep red...");
1949 if (!get_aim_dir(&dir)) return FALSE;
1950 fire_ball(GF_FIRE, dir, 120, 3);
1951 o_ptr->timeout = randint0(225) + 225;
1958 msg_print("ÌÀ¤ë¤¯Çò¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
1960 msg_print("It glows bright white...");
1963 if (!get_aim_dir(&dir)) return FALSE;
1964 fire_ball(GF_COLD, dir, 200, 3);
1965 o_ptr->timeout = randint0(325) + 325;
1972 msg_print("¿¼ÀÄ¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
1974 msg_print("It glows deep blue...");
1977 if (!get_aim_dir(&dir)) return FALSE;
1978 fire_ball(GF_ELEC, dir, 250, 3);
1979 o_ptr->timeout = randint0(425) + 425;
1988 monster_type *m_ptr;
1990 for (dir = 0; dir <= 9; dir++)
1994 c_ptr = &cave[y][x];
1996 /* Get the monster */
1997 m_ptr = &m_list[c_ptr->m_idx];
1999 /* Hack -- attack monsters */
2000 if (c_ptr->m_idx && (m_ptr->ml || cave_floor_bold(y, x)))
2004 o_ptr->timeout = 250;
2010 if (!get_aim_dir(&dir)) return FALSE;
2011 for (dummy = 0; dummy < 3; dummy++)
2013 if (drain_life(dir, 100))
2017 o_ptr->timeout = 400;
2022 case ACT_CALL_CHAOS:
2025 msg_print("ÍÍ¡¹¤Ê¿§¤Î²Ð²Ö¤òȯ¤·¤Æ¤¤¤ë...");
2027 msg_print("It glows in scintillating colours...");
2031 o_ptr->timeout = 350;
2037 if (!get_aim_dir(&dir)) return FALSE;
2039 msg_print("¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡ª");
2041 msg_print("You launch a rocket!");
2044 fire_ball(GF_ROCKET, dir, 250 + plev*3, 2);
2045 o_ptr->timeout = 400;
2052 msg_print("¿ÀÀ»¤ÊÊ·°Ïµ¤¤¬½¼Ëþ¤·¤¿...");
2054 msg_print("It floods the area with goodness...");
2057 dispel_evil(p_ptr->lev * 5);
2058 o_ptr->timeout = randint0(300) + 300;
2065 msg_print("¼Ù°¤ÊÊ·°Ïµ¤¤¬½¼Ëþ¤·¤¿...");
2067 msg_print("It floods the area with evil...");
2070 dispel_good(p_ptr->lev * 5);
2071 o_ptr->timeout = randint0(300) + 300;
2077 if (!get_aim_dir(&dir)) return FALSE;
2079 msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
2081 msg_print("You breathe the elements.");
2084 fire_ball(GF_MISSILE, dir, 300, 4);
2085 o_ptr->timeout = 500;
2089 /* Activate for other offensive action */
2094 msg_print("ÍÍ¡¹¤Ê¿§¤Î²Ð²Ö¤òȯ¤·¤Æ¤¤¤ë...");
2096 msg_print("It glows in scintillating colours...");
2099 if (!get_aim_dir(&dir)) return FALSE;
2100 confuse_monster(dir, 20);
2101 o_ptr->timeout = 15;
2108 msg_print("¿¼ÀÄ¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2110 msg_print("It glows deep blue...");
2113 sleep_monsters_touch();
2114 o_ptr->timeout = 55;
2120 earthquake(py, px, 10);
2121 o_ptr->timeout = 50;
2127 turn_monsters(40 + p_ptr->lev);
2128 o_ptr->timeout = 3 * (p_ptr->lev + 10);
2134 if (!get_aim_dir(&dir)) return FALSE;
2135 (void)fire_beam(GF_AWAY_ALL, dir, plev);
2136 o_ptr->timeout = 200;
2140 case ACT_BANISH_EVIL:
2142 if (banish_evil(100))
2145 msg_print("¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È¤ÎÎϤ¬¼Ù°¤òÂǤÁÅݤ·¤¿¡ª");
2147 msg_print("The power of the artifact banishes evil!");
2151 o_ptr->timeout = 250 + randint1(250);
2158 msg_print("¿¼ÀÄ¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2160 msg_print("It glows deep blue...");
2163 (void)symbol_genocide(200, TRUE);
2164 o_ptr->timeout = 500;
2171 msg_print("¤Ò¤É¤¯±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
2173 msg_print("It lets out a long, shrill note...");
2176 (void)mass_genocide(200, TRUE);
2177 o_ptr->timeout = 1000;
2181 /* Activate for summoning / charming */
2183 case ACT_CHARM_ANIMAL:
2185 if (!get_aim_dir(&dir)) return FALSE;
2186 (void)charm_animal(dir, plev);
2187 o_ptr->timeout = 300;
2191 case ACT_CHARM_UNDEAD:
2193 if (!get_aim_dir(&dir)) return FALSE;
2194 (void)control_one_undead(dir, plev);
2195 o_ptr->timeout = 333;
2199 case ACT_CHARM_OTHER:
2201 if (!get_aim_dir(&dir)) return FALSE;
2202 (void)charm_monster(dir, plev);
2203 o_ptr->timeout = 400;
2207 case ACT_CHARM_ANIMALS:
2209 (void)charm_animals(plev * 2);
2210 o_ptr->timeout = 500;
2214 case ACT_CHARM_OTHERS:
2216 charm_monsters(plev * 2);
2217 o_ptr->timeout = 750;
2221 case ACT_SUMMON_ANIMAL:
2223 (void)summon_specific(-1, py, px, plev, SUMMON_ANIMAL_RANGER, TRUE, TRUE, TRUE, FALSE, FALSE);
2224 o_ptr->timeout = 200 + randint1(300);
2228 case ACT_SUMMON_PHANTOM:
2231 msg_print("¸¸Îî¤ò¾¤´¤·¤¿¡£");
2233 msg_print("You summon a phantasmal servant.");
2236 (void)summon_specific(-1, py, px, dun_level, SUMMON_PHANTOM, TRUE, TRUE, TRUE, FALSE, FALSE);
2237 o_ptr->timeout = 200 + randint1(200);
2241 case ACT_SUMMON_ELEMENTAL:
2243 bool pet = one_in_(3);
2244 bool group = !(pet && (plev < 50));
2246 if (summon_specific((pet ? -1 : 0), py, px, ((plev * 3) / 2), SUMMON_ELEMENTAL, group, FALSE, pet, FALSE, (bool)(!pet)))
2249 msg_print("¥¨¥ì¥á¥ó¥¿¥ë¤¬¸½¤ì¤¿...");
2251 msg_print("An elemental materializes...");
2257 msg_print("¤¢¤Ê¤¿¤ËÉþ½¾¤·¤Æ¤¤¤ë¤è¤¦¤À¡£");
2259 msg_print("It seems obedient to you.");
2264 msg_print("¤½¤ì¤ò¥³¥ó¥È¥í¡¼¥ë¤Ç¤¤Ê¤«¤Ã¤¿¡ª");
2266 msg_print("You fail to control it!");
2271 o_ptr->timeout = 750;
2275 case ACT_SUMMON_DEMON:
2277 bool pet = one_in_(3);
2278 bool group = !(pet && (plev < 50));
2280 if (summon_specific((pet ? -1 : 0), py, px, ((plev * 3) / 2), SUMMON_DEMON, group, FALSE, pet, FALSE, (bool)(!pet)))
2283 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
2285 msg_print("The area fills with a stench of sulphur and brimstone.");
2290 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
2292 msg_print("'What is thy bidding... Master?'");
2297 msg_print("¡ÖNON SERVIAM! Wretch! ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
2299 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
2304 o_ptr->timeout = 666 + randint1(333);
2308 case ACT_SUMMON_UNDEAD:
2310 bool pet = one_in_(3);
2315 type = (plev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
2318 group = (((plev > 24) && one_in_(3)) ? TRUE : FALSE);
2319 unique_okay = FALSE;
2327 if (summon_specific((pet ? -1 : 0), py, px, ((plev * 3) / 2), type,
2328 group, FALSE, pet, unique_okay, (bool)(!pet)))
2331 msg_print("Î䤿¤¤É÷¤¬¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¿á¤»Ï¤á¤¿¡£¤½¤ì¤ÏÉåÇÔ½¤ò±¿¤ó¤Ç¤¤¤ë...");
2333 msg_print("Cold winds begin to blow around you, carrying with them the stench of decay...");
2338 msg_print("¸Å¤¨¤Î»à¤»¤ë¼Ô¶¦¤¬¤¢¤Ê¤¿¤Ë»Å¤¨¤ë¤¿¤áÅÚ¤«¤éᴤä¿¡ª");
2340 msg_print("Ancient, long-dead forms arise from the ground to serve you!");
2345 msg_print("»à¼Ô¤¬á´¤Ã¤¿¡£Ì²¤ê¤ò˸¤²¤ë¤¢¤Ê¤¿¤òȳ¤¹¤ë¤¿¤á¤Ë¡ª");
2347 msg_print("'The dead arise... to punish you for disturbing them!'");
2352 o_ptr->timeout = 666 + randint1(333);
2356 /* Activate for healing */
2360 (void)set_afraid(0);
2361 (void)hp_player(30);
2362 o_ptr->timeout = 10;
2369 msg_print("¿¼»ç¿§¤Î¸÷¤òȯ¤·¤Æ¤¤¤ë...");
2371 msg_print("It radiates deep purple...");
2374 hp_player(damroll(4, 8));
2375 (void)set_cut((p_ptr->cut / 2) - 50);
2376 o_ptr->timeout = randint0(3) + 3;
2380 case ACT_CURE_POISON:
2383 msg_print("¿¼ÀÄ¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2385 msg_print("It glows deep blue...");
2388 (void)set_afraid(0);
2389 (void)set_poisoned(0);
2397 msg_print("¿¼¹È¤Ëµ±¤¤¤Æ¤¤¤ë...");
2399 msg_print("It glows a deep red...");
2403 o_ptr->timeout = 450;
2410 msg_print("Ç»Îп§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2412 msg_print("It glows a deep green...");
2415 (void)do_res_stat(A_STR);
2416 (void)do_res_stat(A_INT);
2417 (void)do_res_stat(A_WIS);
2418 (void)do_res_stat(A_DEX);
2419 (void)do_res_stat(A_CON);
2420 (void)do_res_stat(A_CHR);
2421 (void)restore_level();
2422 o_ptr->timeout = 750;
2429 msg_print("¿¼ÀÄ¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2431 msg_print("It glows deep blue...");
2435 msg_print("ÂÎÆâ¤ËÃȤ«¤¤¸ÝÆ°¤¬´¶¤¸¤é¤ì¤ë...");
2437 msg_print("You feel a warm tingling inside...");
2440 (void)hp_player(700);
2442 o_ptr->timeout = 250;
2449 msg_print("Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤Æ¤¤¤ë...");
2451 msg_print("It glows a bright white...");
2455 msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬¤è¤¤...");
2457 msg_print("You feel much better...");
2460 (void)hp_player(1000);
2462 o_ptr->timeout = 888;
2466 /* Activate for timed effect */
2470 (void)set_tim_esp(randint1(30) + 25, FALSE);
2471 o_ptr->timeout = 200;
2477 (void)set_hero(randint1(50) + 50, FALSE);
2478 (void)set_blessed(randint1(50) + 50, FALSE);
2479 o_ptr->timeout = 100 + randint1(100);
2486 msg_print("±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
2488 msg_print("It lets out a shrill wail...");
2492 (void)set_protevil(randint1(25) + k, FALSE);
2493 o_ptr->timeout = randint0(225) + 225;
2497 case ACT_RESIST_ALL:
2500 msg_print("ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2502 msg_print("It glows many colours...");
2505 (void)set_oppose_acid(randint1(40) + 40, FALSE);
2506 (void)set_oppose_elec(randint1(40) + 40, FALSE);
2507 (void)set_oppose_fire(randint1(40) + 40, FALSE);
2508 (void)set_oppose_cold(randint1(40) + 40, FALSE);
2509 (void)set_oppose_pois(randint1(40) + 40, FALSE);
2510 o_ptr->timeout = 200;
2517 msg_print("ÌÀ¤ë¤¯Îп§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2519 msg_print("It glows bright green...");
2522 (void)set_fast(randint1(20) + 20, FALSE);
2523 o_ptr->timeout = 250;
2527 case ACT_XTRA_SPEED:
2530 msg_print("ÌÀ¤ë¤¯µ±¤¤¤Æ¤¤¤ë...");
2532 msg_print("It glows brightly...");
2535 (void)set_fast(randint1(75) + 75, FALSE);
2536 o_ptr->timeout = randint0(200) + 200;
2542 set_wraith_form(randint1(plev / 2) + (plev / 2), FALSE);
2543 o_ptr->timeout = 1000;
2549 (void)set_invuln(randint1(8) + 8, FALSE);
2550 o_ptr->timeout = 1000;
2554 /* Activate for general purpose effect (detection etc.) */
2559 msg_print("À¡¤ó¤À¸÷¤¬¤¢¤Õ¤ì½Ð¤¿...");
2561 msg_print("It wells with clear light...");
2564 lite_area(damroll(2, 15), 3);
2565 o_ptr->timeout = randint0(10) + 10;
2572 msg_print("âÁ¤·¤¯µ±¤¤¤¿...");
2574 msg_print("It shines brightly...");
2577 map_area(DETECT_RAD_MAP);
2578 lite_area(damroll(2, 15), 3);
2579 o_ptr->timeout = randint0(50) + 50;
2583 case ACT_DETECT_ALL:
2586 msg_print("Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤Æ¤¤¤ë...");
2588 msg_print("It glows bright white...");
2592 msg_print("¿´¤Ë¥¤¥á¡¼¥¸¤¬É⤫¤ó¤Ç¤¤¿...");
2594 msg_print("An image forms in your mind...");
2597 detect_all(DETECT_RAD_DEFAULT);
2598 o_ptr->timeout = randint0(55) + 55;
2602 case ACT_DETECT_XTRA:
2605 msg_print("ÌÀ¤ë¤¯µ±¤¤¤Æ¤¤¤ë...");
2607 msg_print("It glows brightly...");
2610 detect_all(DETECT_RAD_DEFAULT);
2612 identify_fully(FALSE);
2613 o_ptr->timeout = 1000;
2620 msg_print("²«¿§¤¯µ±¤¤¤Æ¤¤¤ë...");
2622 msg_print("It glows yellow...");
2625 identify_fully(FALSE);
2626 o_ptr->timeout = 750;
2632 if (!ident_spell(FALSE)) return FALSE;
2633 o_ptr->timeout = 10;
2637 case ACT_RUNE_EXPLO:
2640 msg_print("ÌÀ¤ë¤¤ÀÖ¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2642 msg_print("It glows bright red...");
2646 o_ptr->timeout = 200;
2653 msg_print("¥Ö¥ë¡¼¤ËÌÀ¤ë¤¯µ±¤¤¤Æ¤¤¤ë...");
2655 msg_print("It glows light blue...");
2659 o_ptr->timeout = 400;
2665 (void)set_food(PY_FOOD_MAX - 1);
2666 o_ptr->timeout = 200;
2673 msg_print("ÌÀ¤ë¤¤ÀÖ¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2675 msg_print("It glows bright red...");
2678 destroy_doors_touch();
2679 o_ptr->timeout = 10;
2686 msg_print("¸ÝÆ°¤·¤Æ¤¤¤ë...");
2688 msg_print("It pulsates...");
2691 if (!get_aim_dir(&dir)) return FALSE;
2700 o_ptr->timeout = 70;
2707 msg_print("ÌÀ¤ë¤¤²«¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2709 msg_print("It glows bright yellow...");
2713 o_ptr->timeout = 500;
2720 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
2722 msg_print("You open a dimensional gate. Choose a destination.");
2725 if (!dimension_door()) return FALSE;
2726 o_ptr->timeout = 100;
2734 msg_print("¼þ¤ê¤Î¶õ´Ö¤¬ÏĤó¤Ç¤¤¤ë...");
2736 msg_print("It twists space around you...");
2739 teleport_player(100);
2740 o_ptr->timeout = 45;
2747 msg_print("¤ä¤ï¤é¤«¤ÊÇò¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2749 msg_print("It glows soft white...");
2751 if (!word_of_recall()) return FALSE;
2752 o_ptr->timeout = 200;
2759 msg_format("Unknown activation effect: %d.", o_ptr->xtra2);
2761 msg_format("Unknown activation effect: %d.", o_ptr->xtra2);
2772 void random_artifact_resistance(object_type * o_ptr)
2774 bool give_resistance = FALSE, give_power = FALSE;
2776 if (o_ptr->name1 == ART_TERROR) /* Terror Mask is for warriors... */
2778 if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_ARCHER || p_ptr->pclass == CLASS_CAVALRY || p_ptr->pclass == CLASS_BERSERKER)
2781 give_resistance = TRUE;
2785 o_ptr->art_flags3 |=
2786 (TR3_CURSED | TR3_HEAVY_CURSE | TR3_AGGRAVATE | TR3_TY_CURSE);
2787 o_ptr->ident |= IDENT_CURSED;
2791 if (o_ptr->name1 == ART_MURAMASA)
2793 if (p_ptr->pclass != CLASS_SAMURAI)
2795 o_ptr->art_flags3 |= (TR3_NO_TELE | TR3_NO_MAGIC | TR3_HEAVY_CURSE);
2796 o_ptr->ident |= IDENT_CURSED;
2800 if (o_ptr->name1 == ART_XIAOLONG)
2802 if (p_ptr->pclass == CLASS_MONK)
2803 o_ptr->art_flags1 |= TR1_BLOWS;
2806 if (o_ptr->name1 == ART_BLOOD)
2809 dummy = randint1(2)+randint1(2);
2810 for (i = 0; i < dummy; i++)
2811 o_ptr->art_flags1 |= (TR1_CHAOTIC << randint0(18));
2812 dummy = randint1(2);
2813 for (i = 0; i < dummy; i++)
2814 random_resistance(o_ptr, FALSE, randint1(34) + 4);
2816 for (i = 0; i < dummy; i++)
2818 int tmp = randint0(11);
2819 if (tmp < 6) o_ptr->art_flags1 |= (TR1_STR << tmp);
2820 else o_ptr->art_flags1 |= (TR1_STEALTH << (tmp - 6));
2824 switch (o_ptr->name1)
2842 case ART_THALKETTOTH:
2845 /* Give a resistance */
2846 give_resistance = TRUE;
2861 /* Give a resistance OR a power */
2862 if (one_in_(2)) give_resistance = TRUE;
2863 else give_power = TRUE;
2884 give_resistance = TRUE;
2891 o_ptr->xtra1 = EGO_XTRA_ABILITY;
2893 /* Randomize the "xtra" power */
2894 if (o_ptr->xtra1) o_ptr->xtra2 = randint1(256);
2899 if (give_resistance)
2901 random_resistance(o_ptr, FALSE, randint1(22) + 16);
2907 * Create the artifact of the specified number
2909 void create_named_art(int a_idx, int y, int x)
2915 artifact_type *a_ptr = &a_info[a_idx];
2917 /* Get local object */
2920 /* Ignore "empty" artifacts */
2921 if (!a_ptr->name) return;
2923 /* Acquire the "kind" index */
2924 i = lookup_kind(a_ptr->tval, a_ptr->sval);
2929 /* Create the artifact */
2930 object_prep(q_ptr, i);
2933 q_ptr->name1 = a_idx;
2935 /* Extract the fields */
2936 q_ptr->pval = a_ptr->pval;
2937 q_ptr->ac = a_ptr->ac;
2938 q_ptr->dd = a_ptr->dd;
2939 q_ptr->ds = a_ptr->ds;
2940 q_ptr->to_a = a_ptr->to_a;
2941 q_ptr->to_h = a_ptr->to_h;
2942 q_ptr->to_d = a_ptr->to_d;
2943 q_ptr->weight = a_ptr->weight;
2945 /* Hack -- acquire "cursed" flag */
2946 if (a_ptr->flags3 & TR3_CURSED) q_ptr->ident |= (IDENT_CURSED);
2948 random_artifact_resistance(q_ptr);
2950 /* Drop the artifact from heaven */
2951 (void)drop_near(q_ptr, -1, y, x);