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 + randint(4));
31 if (o_ptr->to_a > 0) o_ptr->to_a = 0 - (o_ptr->to_a + randint(4));
32 if (o_ptr->to_h > 0) o_ptr->to_h = 0 - (o_ptr->to_h + randint(4));
33 if (o_ptr->to_d > 0) o_ptr->to_d = 0 - (o_ptr->to_d + randint(4));
35 o_ptr->art_flags3 |= (TR3_HEAVY_CURSE | TR3_CURSED);
37 if (randint(4) == 1) o_ptr->art_flags3 |= TR3_PERMA_CURSE;
38 if (randint(3) == 1) o_ptr->art_flags3 |= TR3_TY_CURSE;
39 if (randint(2) == 1) o_ptr->art_flags3 |= TR3_AGGRAVATE;
40 if (randint(3) == 1) o_ptr->art_flags3 |= TR3_DRAIN_EXP;
41 if (randint(2) == 1) o_ptr->art_flags3 |= TR3_TELEPORT;
42 else if (randint(3) == 1) 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) && (randint(3) == 1))
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 (randint(2) == 1) 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 (randint(2) == 1) return;
69 if (!(o_ptr->art_flags1 & TR1_DEX))
71 o_ptr->art_flags1 |= TR1_DEX;
72 if (randint(2) == 1) 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 (randint(2) == 1) 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 (randint(2) == 1) 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 (randint(2) == 1) 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 (randint(2) == 1) return;
104 if (!(o_ptr->art_flags1 & TR1_CON))
106 o_ptr->art_flags1 |= TR1_CON;
107 if (randint(2) == 1) 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 (randint(2) == 1) 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 (randint(2) == 1) return;
123 if (!(o_ptr->art_flags1 & TR1_SEARCH))
125 o_ptr->art_flags1 |= TR1_SEARCH;
126 if (randint(2) == 1) 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 (randint(2) == 1) 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 (randint(2) == 1) 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 (randint(2) == 1) 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 (randint(2) == 1) 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 (randint(2) == 1) 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 (randint(2) == 1) 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 (randint(2) == 1) return;
187 switch (randint(this_type))
190 o_ptr->art_flags1 |= TR1_STR;
191 /* if (is_scroll) msg_print("It makes you feel strong!"); */
192 if (!artifact_bias && randint(13) != 1)
193 artifact_bias = BIAS_STR;
194 else if (!artifact_bias && randint(7) == 1)
195 artifact_bias = BIAS_WARRIOR;
198 o_ptr->art_flags1 |= TR1_INT;
199 /* if (is_scroll) msg_print("It makes you feel smart!"); */
200 if (!artifact_bias && randint(13) != 1)
201 artifact_bias = BIAS_INT;
202 else if (!artifact_bias && randint(7) == 1)
203 artifact_bias = BIAS_MAGE;
206 o_ptr->art_flags1 |= TR1_WIS;
207 /* if (is_scroll) msg_print("It makes you feel wise!"); */
208 if (!artifact_bias && randint(13) != 1)
209 artifact_bias = BIAS_WIS;
210 else if (!artifact_bias && randint(7) == 1)
211 artifact_bias = BIAS_PRIESTLY;
214 o_ptr->art_flags1 |= TR1_DEX;
215 /* if (is_scroll) msg_print("It makes you feel nimble!"); */
216 if (!artifact_bias && randint(13) != 1)
217 artifact_bias = BIAS_DEX;
218 else if (!artifact_bias && randint(7) == 1)
219 artifact_bias = BIAS_ROGUE;
222 o_ptr->art_flags1 |= TR1_CON;
223 /* if (is_scroll) msg_print("It makes you feel healthy!"); */
224 if (!artifact_bias && randint(13) != 1)
225 artifact_bias = BIAS_CON;
226 else if (!artifact_bias && randint(9) == 1)
227 artifact_bias = BIAS_RANGER;
230 o_ptr->art_flags1 |= TR1_CHR;
231 /* if (is_scroll) msg_print("It makes you look great!"); */
232 if (!artifact_bias && randint(13) != 1)
233 artifact_bias = BIAS_CHR;
236 o_ptr->art_flags1 |= TR1_STEALTH;
237 /* if (is_scroll) msg_print("It looks muffled."); */
238 if (!artifact_bias && randint(3) == 1)
239 artifact_bias = BIAS_ROGUE;
242 o_ptr->art_flags1 |= TR1_SEARCH;
243 /* if (is_scroll) msg_print("It makes you see better."); */
244 if (!artifact_bias && randint(9) == 1)
245 artifact_bias = BIAS_RANGER;
248 o_ptr->art_flags1 |= TR1_INFRA;
249 /* if (is_scroll) msg_print("It makes you see tiny red animals.");*/
252 o_ptr->art_flags1 |= TR1_SPEED;
253 /* if (is_scroll) msg_print("It makes you move faster!"); */
254 if (!artifact_bias && randint(11) == 1)
255 artifact_bias = BIAS_ROGUE;
258 o_ptr->art_flags1 |= TR1_TUNNEL;
259 /* if (is_scroll) msg_print("Gravel flies from it!"); */
262 if (o_ptr->tval == TV_BOW) random_plus(o_ptr, is_scroll);
265 o_ptr->art_flags1 |= TR1_BLOWS;
266 /* if (is_scroll) msg_print("It seems faster!"); */
267 if (!artifact_bias && randint(11) == 1)
268 artifact_bias = BIAS_WARRIOR;
275 void random_resistance(object_type * o_ptr, bool is_scroll, int specific)
277 if (!specific) /* To avoid a number of possible bugs */
279 if (artifact_bias == BIAS_ACID)
281 if (!(o_ptr->art_flags2 & TR2_RES_ACID))
283 o_ptr->art_flags2 |= TR2_RES_ACID;
284 if (randint(2) == 1) return;
286 if ((randint(BIAS_LUCK) == 1) && !(o_ptr->art_flags2 & TR2_IM_ACID))
288 o_ptr->art_flags2 |= TR2_IM_ACID;
289 if (!one_in_(IM_LUCK)) o_ptr->art_flags2 &= ~(TR2_IM_ELEC | TR2_IM_COLD | TR2_IM_FIRE);
290 if (randint(2) == 1) return;
293 else if (artifact_bias == BIAS_ELEC)
295 if (!(o_ptr->art_flags2 & TR2_RES_ELEC))
297 o_ptr->art_flags2 |= TR2_RES_ELEC;
298 if (randint(2) == 1) return;
300 if ((o_ptr->tval >= TV_CLOAK) && (o_ptr->tval <= TV_HARD_ARMOR) &&
301 !(o_ptr->art_flags3 & TR3_SH_ELEC))
303 o_ptr->art_flags3 |= TR3_SH_ELEC;
304 if (randint(2) == 1) return;
306 if (randint(BIAS_LUCK) == 1 && !(o_ptr->art_flags2 & TR2_IM_ELEC))
308 o_ptr->art_flags2 |= TR2_IM_ELEC;
309 if (!one_in_(IM_LUCK)) o_ptr->art_flags2 &= ~(TR2_IM_ACID | TR2_IM_COLD | TR2_IM_FIRE);
310 if (randint(2) == 1) return;
313 else if (artifact_bias == BIAS_FIRE)
315 if (!(o_ptr->art_flags2 & TR2_RES_FIRE))
317 o_ptr->art_flags2 |= TR2_RES_FIRE;
318 if (randint(2) == 1) return;
320 if ((o_ptr->tval >= TV_CLOAK) &&
321 (o_ptr->tval <= TV_HARD_ARMOR) &&
322 !(o_ptr->art_flags3 & TR3_SH_FIRE))
324 o_ptr->art_flags3 |= TR3_SH_FIRE;
325 if (randint(2) == 1) return;
327 if ((randint(BIAS_LUCK) == 1) &&
328 !(o_ptr->art_flags2 & TR2_IM_FIRE))
330 o_ptr->art_flags2 |= TR2_IM_FIRE;
331 if (!one_in_(IM_LUCK)) o_ptr->art_flags2 &= ~(TR2_IM_ELEC | TR2_IM_COLD | TR2_IM_ACID);
332 if (randint(2) == 1) return;
335 else if (artifact_bias == BIAS_COLD)
337 if (!(o_ptr->art_flags2 & TR2_RES_COLD))
339 o_ptr->art_flags2 |= TR2_RES_COLD;
340 if (randint(2) == 1) return;
342 if ((o_ptr->tval >= TV_CLOAK) &&
343 (o_ptr->tval <= TV_HARD_ARMOR) &&
344 !(o_ptr->art_flags3 & TR3_SH_COLD))
346 o_ptr->art_flags3 |= TR3_SH_COLD;
347 if (randint(2) == 1) return;
349 if (randint(BIAS_LUCK) == 1 && !(o_ptr->art_flags2 & TR2_IM_COLD))
351 o_ptr->art_flags2 |= TR2_IM_COLD;
352 if (!one_in_(IM_LUCK)) o_ptr->art_flags2 &= ~(TR2_IM_ELEC | TR2_IM_ACID | TR2_IM_FIRE);
353 if (randint(2) == 1) return;
356 else if (artifact_bias == BIAS_POIS)
358 if (!(o_ptr->art_flags2 & TR2_RES_POIS))
360 o_ptr->art_flags2 |= TR2_RES_POIS;
361 if (randint(2) == 1) return;
364 else if (artifact_bias == BIAS_WARRIOR)
366 if (randint(3) != 1 && (!(o_ptr->art_flags2 & TR2_RES_FEAR)))
368 o_ptr->art_flags2 |= TR2_RES_FEAR;
369 if (randint(2) == 1) return;
371 if ((randint(3) == 1) && (!(o_ptr->art_flags3 & TR3_NO_MAGIC)))
373 o_ptr->art_flags3 |= TR3_NO_MAGIC;
374 if (randint(2) == 1) return;
377 else if (artifact_bias == BIAS_NECROMANTIC)
379 if (!(o_ptr->art_flags2 & TR2_RES_NETHER))
381 o_ptr->art_flags2 |= TR2_RES_NETHER;
382 if (randint(2) == 1) return;
384 if (!(o_ptr->art_flags2 & TR2_RES_POIS))
386 o_ptr->art_flags2 |= TR2_RES_POIS;
387 if (randint(2) == 1) return;
389 if (!(o_ptr->art_flags2 & TR2_RES_DARK))
391 o_ptr->art_flags2 |= TR2_RES_DARK;
392 if (randint(2) == 1) return;
395 else if (artifact_bias == BIAS_CHAOS)
397 if (!(o_ptr->art_flags2 & TR2_RES_CHAOS))
399 o_ptr->art_flags2 |= TR2_RES_CHAOS;
400 if (randint(2) == 1) return;
402 if (!(o_ptr->art_flags2 & TR2_RES_CONF))
404 o_ptr->art_flags2 |= TR2_RES_CONF;
405 if (randint(2) == 1) return;
407 if (!(o_ptr->art_flags2 & TR2_RES_DISEN))
409 o_ptr->art_flags2 |= TR2_RES_DISEN;
410 if (randint(2) == 1) return;
415 switch (specific ? specific : randint(42))
418 if (randint(WEIRD_LUCK) != 1)
419 random_resistance(o_ptr, is_scroll, specific);
422 o_ptr->art_flags2 |= TR2_IM_ACID;
423 /* if (is_scroll) msg_print("It looks totally incorruptible."); */
425 artifact_bias = BIAS_ACID;
429 if (randint(WEIRD_LUCK) != 1)
430 random_resistance(o_ptr, is_scroll, specific);
433 o_ptr->art_flags2 |= TR2_IM_ELEC;
434 /* if (is_scroll) msg_print("It looks completely grounded."); */
436 artifact_bias = BIAS_ELEC;
440 if (randint(WEIRD_LUCK) != 1)
441 random_resistance(o_ptr, is_scroll, specific);
444 o_ptr->art_flags2 |= TR2_IM_COLD;
445 /* if (is_scroll) msg_print("It feels very warm."); */
447 artifact_bias = BIAS_COLD;
451 if (randint(WEIRD_LUCK) != 1)
452 random_resistance(o_ptr, is_scroll, specific);
455 o_ptr->art_flags2 |= TR2_IM_FIRE;
456 /* if (is_scroll) msg_print("It feels very cool."); */
458 artifact_bias = BIAS_FIRE;
464 o_ptr->art_flags2 |= TR2_RES_ACID;
465 /* if (is_scroll) msg_print("It makes your stomach rumble."); */
467 artifact_bias = BIAS_ACID;
472 o_ptr->art_flags2 |= TR2_RES_ELEC;
473 /* if (is_scroll) msg_print("It makes you feel grounded."); */
475 artifact_bias = BIAS_ELEC;
480 o_ptr->art_flags2 |= TR2_RES_FIRE;
481 /* if (is_scroll) msg_print("It makes you feel cool!");*/
483 artifact_bias = BIAS_FIRE;
488 o_ptr->art_flags2 |= TR2_RES_COLD;
489 /* if (is_scroll) msg_print("It makes you feel full of hot air!");*/
491 artifact_bias = BIAS_COLD;
495 o_ptr->art_flags2 |= TR2_RES_POIS;
496 /* if (is_scroll) msg_print("It makes breathing easier for you."); */
497 if (!artifact_bias && randint(4) != 1)
498 artifact_bias = BIAS_POIS;
499 else if (!artifact_bias && randint(2) == 1)
500 artifact_bias = BIAS_NECROMANTIC;
501 else if (!artifact_bias && randint(2) == 1)
502 artifact_bias = BIAS_ROGUE;
506 o_ptr->art_flags2 |= TR2_RES_FEAR;
507 /* if (is_scroll) msg_print("It makes you feel brave!"); */
508 if (!artifact_bias && randint(3) == 1)
509 artifact_bias = BIAS_WARRIOR;
512 o_ptr->art_flags2 |= TR2_RES_LITE;
513 /* if (is_scroll) msg_print("It makes everything look darker.");*/
516 o_ptr->art_flags2 |= TR2_RES_DARK;
517 /* if (is_scroll) msg_print("It makes everything look brighter.");*/
521 o_ptr->art_flags2 |= TR2_RES_BLIND;
522 /* if (is_scroll) msg_print("It makes you feel you are wearing glasses.");*/
526 o_ptr->art_flags2 |= TR2_RES_CONF;
527 /* if (is_scroll) msg_print("It makes you feel very determined.");*/
528 if (!artifact_bias && randint(6) == 1)
529 artifact_bias = BIAS_CHAOS;
533 o_ptr->art_flags2 |= TR2_RES_SOUND;
534 /* if (is_scroll) msg_print("It makes you feel deaf!");*/
538 o_ptr->art_flags2 |= TR2_RES_SHARDS;
539 /* if (is_scroll) msg_print("It makes your skin feel thicker.");*/
543 o_ptr->art_flags2 |= TR2_RES_NETHER;
544 /* if (is_scroll) msg_print("It makes you feel like visiting a graveyard!");*/
545 if (!artifact_bias && randint(3) == 1)
546 artifact_bias = BIAS_NECROMANTIC;
550 o_ptr->art_flags2 |= TR2_RES_NEXUS;
551 /* if (is_scroll) msg_print("It makes you feel normal.");*/
555 o_ptr->art_flags2 |= TR2_RES_CHAOS;
556 /* if (is_scroll) msg_print("It makes you feel very firm.");*/
557 if (!artifact_bias && randint(2) == 1)
558 artifact_bias = BIAS_CHAOS;
562 o_ptr->art_flags2 |= TR2_RES_DISEN;
563 /* if (is_scroll) msg_print("It is surrounded by a static feeling.");*/
566 if (o_ptr->tval >= TV_CLOAK && o_ptr->tval <= TV_HARD_ARMOR)
567 o_ptr->art_flags3 |= TR3_SH_ELEC;
569 random_resistance(o_ptr, is_scroll, specific);
571 artifact_bias = BIAS_ELEC;
574 if (o_ptr->tval >= TV_CLOAK && o_ptr->tval <= TV_HARD_ARMOR)
575 o_ptr->art_flags3 |= TR3_SH_FIRE;
577 random_resistance(o_ptr, is_scroll, specific);
579 artifact_bias = BIAS_FIRE;
582 if (o_ptr->tval == TV_SHIELD || o_ptr->tval == TV_CLOAK ||
583 o_ptr->tval == TV_HELM || o_ptr->tval == TV_HARD_ARMOR)
584 o_ptr->art_flags2 |= TR2_REFLECT;
586 random_resistance(o_ptr, is_scroll, specific);
589 if (o_ptr->tval >= TV_CLOAK && o_ptr->tval <= TV_HARD_ARMOR)
590 o_ptr->art_flags3 |= TR3_SH_COLD;
592 random_resistance(o_ptr, is_scroll, specific);
594 artifact_bias = BIAS_COLD;
601 static void random_misc(object_type * o_ptr, bool is_scroll)
603 if (artifact_bias == BIAS_RANGER)
605 if (!(o_ptr->art_flags2 & TR2_SUST_CON))
607 o_ptr->art_flags2 |= TR2_SUST_CON;
608 if (randint(2) == 1) return;
611 else if (artifact_bias == BIAS_STR)
613 if (!(o_ptr->art_flags2 & TR2_SUST_STR))
615 o_ptr->art_flags2 |= TR2_SUST_STR;
616 if (randint(2) == 1) return;
619 else if (artifact_bias == BIAS_WIS)
621 if (!(o_ptr->art_flags2 & TR2_SUST_WIS))
623 o_ptr->art_flags2 |= TR2_SUST_WIS;
624 if (randint(2) == 1) return;
627 else if (artifact_bias == BIAS_INT)
629 if (!(o_ptr->art_flags2 & TR2_SUST_INT))
631 o_ptr->art_flags2 |= TR2_SUST_INT;
632 if (randint(2) == 1) return;
635 else if (artifact_bias == BIAS_DEX)
637 if (!(o_ptr->art_flags2 & TR2_SUST_DEX))
639 o_ptr->art_flags2 |= TR2_SUST_DEX;
640 if (randint(2) == 1) return;
643 else if (artifact_bias == BIAS_CON)
645 if (!(o_ptr->art_flags2 & TR2_SUST_CON))
647 o_ptr->art_flags2 |= TR2_SUST_CON;
648 if (randint(2) == 1) return;
651 else if (artifact_bias == BIAS_CHR)
653 if (!(o_ptr->art_flags2 & TR2_SUST_CHR))
655 o_ptr->art_flags2 |= TR2_SUST_CHR;
656 if (randint(2) == 1) return;
659 else if (artifact_bias == BIAS_CHAOS)
661 if (!(o_ptr->art_flags3 & TR3_TELEPORT))
663 o_ptr->art_flags3 |= TR3_TELEPORT;
664 if (randint(2) == 1) return;
667 else if (artifact_bias == BIAS_FIRE)
669 if (!(o_ptr->art_flags3 & TR3_LITE))
671 o_ptr->art_flags3 |= TR3_LITE; /* Freebie */
678 o_ptr->art_flags2 |= TR2_SUST_STR;
679 /* if (is_scroll) msg_print("It makes you feel you cannot become weaker."); */
681 artifact_bias = BIAS_STR;
684 o_ptr->art_flags2 |= TR2_SUST_INT;
685 /* if (is_scroll) msg_print("It makes you feel you cannot become more stupid.");*/
687 artifact_bias = BIAS_INT;
690 o_ptr->art_flags2 |= TR2_SUST_WIS;
691 /* if (is_scroll) msg_print("It makes you feel you cannot become simpler.");*/
693 artifact_bias = BIAS_WIS;
696 o_ptr->art_flags2 |= TR2_SUST_DEX;
697 /* if (is_scroll) msg_print("It makes you feel you cannot become clumsier.");*/
699 artifact_bias = BIAS_DEX;
702 o_ptr->art_flags2 |= TR2_SUST_CON;
703 /* if (is_scroll) msg_print("It makes you feel you cannot become less healthy.");*/
705 artifact_bias = BIAS_CON;
708 o_ptr->art_flags2 |= TR2_SUST_CHR;
709 /* if (is_scroll) msg_print("It makes you feel you cannot become uglier.");*/
711 artifact_bias = BIAS_CHR;
716 o_ptr->art_flags2 |= TR2_FREE_ACT;
717 /* if (is_scroll) msg_print("It makes you feel like a young rebel!");*/
720 o_ptr->art_flags2 |= TR2_HOLD_LIFE;
721 /* if (is_scroll) msg_print("It makes you feel immortal.");*/
722 if (!artifact_bias && (randint(5) == 1))
723 artifact_bias = BIAS_PRIESTLY;
724 else if (!artifact_bias && (randint(6) == 1))
725 artifact_bias = BIAS_NECROMANTIC;
729 o_ptr->art_flags3 |= TR3_LITE;
730 /* if (is_scroll) msg_print("It starts shining.");*/
734 o_ptr->art_flags3 |= TR3_FEATHER;
735 /* if (is_scroll) msg_print("It feels lighter.");*/
740 o_ptr->art_flags3 |= TR3_SEE_INVIS;
741 /* if (is_scroll) msg_print("It makes you see the air!");*/
744 if (randint(3) == 1) break;
745 o_ptr->art_flags3 |= TR3_TELEPATHY;
746 /* if (is_scroll) msg_print("It makes you hear voices inside your head!");*/
747 if (!artifact_bias && (randint(9) == 1))
748 artifact_bias = BIAS_MAGE;
752 o_ptr->art_flags3 |= TR3_SLOW_DIGEST;
753 /* if (is_scroll) msg_print("It makes you feel less hungry.");*/
757 o_ptr->art_flags3 |= TR3_REGEN;
758 /* if (is_scroll) msg_print("It looks as good as new.");*/
761 o_ptr->art_flags3 |= TR3_TELEPORT;
762 /* if (is_scroll) msg_print("Its position feels uncertain!");*/
767 if (o_ptr->tval >= TV_BOOTS && o_ptr->tval <= TV_DRAG_ARMOR)
768 random_misc(o_ptr, is_scroll);
771 o_ptr->to_a = 4 + randint(11);
778 int bonus_h, bonus_d;
779 o_ptr->art_flags3 |= TR3_SHOW_MODS;
780 bonus_h = 4 + (randint(11));
781 bonus_d = 4 + (randint(11));
782 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))
787 o_ptr->to_h += bonus_h;
788 o_ptr->to_d += bonus_d;
792 o_ptr->art_flags3 |= TR3_NO_MAGIC;
795 o_ptr->art_flags3 |= TR3_NO_TELE;
801 static void random_slay(object_type *o_ptr, bool is_scroll)
803 if (artifact_bias == BIAS_CHAOS && (o_ptr->tval != TV_BOW))
805 if (!(o_ptr->art_flags1 & TR1_CHAOTIC))
807 o_ptr->art_flags1 |= TR1_CHAOTIC;
808 if (randint(2) == 1) return;
812 else if (artifact_bias == BIAS_PRIESTLY &&
813 (o_ptr->tval == TV_SWORD || o_ptr->tval == TV_POLEARM) &&
814 !(o_ptr->art_flags3 & TR3_BLESSED))
816 /* A free power for "priestly" random artifacts */
817 o_ptr->art_flags3 |= TR3_BLESSED;
820 else if (artifact_bias == BIAS_NECROMANTIC && (o_ptr->tval != TV_BOW))
822 if (!(o_ptr->art_flags1 & TR1_VAMPIRIC))
824 o_ptr->art_flags1 |= TR1_VAMPIRIC;
825 if (randint(2) == 1) return;
827 if (!(o_ptr->art_flags1 & TR1_BRAND_POIS) && (randint(2) == 1))
829 o_ptr->art_flags1 |= TR1_BRAND_POIS;
830 if (randint(2) == 1) return;
834 else if (artifact_bias == BIAS_RANGER && (o_ptr->tval != TV_BOW))
836 if (!(o_ptr->art_flags1 & TR1_SLAY_ANIMAL))
838 o_ptr->art_flags1 |= TR1_SLAY_ANIMAL;
839 if (randint(2) == 1) return;
843 else if (artifact_bias == BIAS_ROGUE && (o_ptr->tval != TV_BOW))
845 if ((((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DAGGER)) ||
846 ((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_SPEAR))) &&
847 !(o_ptr->art_flags2 & TR2_THROW))
849 /* Free power for rogues... */
850 o_ptr->art_flags2 |= TR2_THROW;
852 if (!(o_ptr->art_flags1 & TR1_BRAND_POIS))
854 o_ptr->art_flags1 |= TR1_BRAND_POIS;
855 if (randint(2) == 1) return;
859 else if (artifact_bias == BIAS_POIS && (o_ptr->tval != TV_BOW))
861 if (!(o_ptr->art_flags1 & TR1_BRAND_POIS))
863 o_ptr->art_flags1 |= TR1_BRAND_POIS;
864 if (randint(2) == 1) return;
868 else if (artifact_bias == BIAS_FIRE && (o_ptr->tval != TV_BOW))
870 if (!(o_ptr->art_flags1 & TR1_BRAND_FIRE))
872 o_ptr->art_flags1 |= TR1_BRAND_FIRE;
873 if (randint(2) == 1) return;
877 else if (artifact_bias == BIAS_COLD && (o_ptr->tval != TV_BOW))
879 if (!(o_ptr->art_flags1 & TR1_BRAND_COLD))
881 o_ptr->art_flags1 |= TR1_BRAND_COLD;
882 if (randint(2) == 1) return;
886 else if (artifact_bias == BIAS_ELEC && (o_ptr->tval != TV_BOW))
888 if (!(o_ptr->art_flags1 & TR1_BRAND_ELEC))
890 o_ptr->art_flags1 |= TR1_BRAND_ELEC;
891 if (randint(2) == 1) return;
895 else if (artifact_bias == BIAS_ACID && (o_ptr->tval != TV_BOW))
897 if (!(o_ptr->art_flags1 & TR1_BRAND_ACID))
899 o_ptr->art_flags1 |= TR1_BRAND_ACID;
900 if (randint(2) == 1) return;
904 else if (artifact_bias == BIAS_LAW && (o_ptr->tval != TV_BOW))
906 if (!(o_ptr->art_flags1 & TR1_SLAY_EVIL))
908 o_ptr->art_flags1 |= TR1_SLAY_EVIL;
909 if (randint(2) == 1) return;
911 if (!(o_ptr->art_flags1 & TR1_SLAY_UNDEAD))
913 o_ptr->art_flags1 |= TR1_SLAY_UNDEAD;
914 if (randint(2) == 1) return;
916 if (!(o_ptr->art_flags1 & TR1_SLAY_DEMON))
918 o_ptr->art_flags1 |= TR1_SLAY_DEMON;
919 if (randint(2) == 1) return;
923 if (o_ptr->tval != TV_BOW)
929 o_ptr->art_flags1 |= TR1_SLAY_ANIMAL;
930 /* if (is_scroll) msg_print("You start hating animals.");*/
934 o_ptr->art_flags1 |= TR1_SLAY_EVIL;
935 /* if (is_scroll) msg_print("You hate evil creatures.");*/
936 if (!artifact_bias && (randint(2) == 1))
937 artifact_bias = BIAS_LAW;
938 else if (!artifact_bias && (randint(9) == 1))
939 artifact_bias = BIAS_PRIESTLY;
943 o_ptr->art_flags1 |= TR1_SLAY_UNDEAD;
944 /* if (is_scroll) msg_print("You hate undead creatures.");*/
945 if (!artifact_bias && (randint(9) == 1))
946 artifact_bias = BIAS_PRIESTLY;
950 o_ptr->art_flags1 |= TR1_SLAY_DEMON;
951 /* if (is_scroll) msg_print("You hate demons.");*/
952 if (!artifact_bias && (randint(9) == 1))
953 artifact_bias = BIAS_PRIESTLY;
957 o_ptr->art_flags1 |= TR1_SLAY_ORC;
958 /* if (is_scroll) msg_print("You hate orcs.");*/
962 o_ptr->art_flags1 |= TR1_SLAY_TROLL;
963 /* if (is_scroll) msg_print("You hate trolls.");*/
967 o_ptr->art_flags1 |= TR1_SLAY_GIANT;
968 /* if (is_scroll) msg_print("You hate giants.");*/
972 o_ptr->art_flags1 |= TR1_SLAY_DRAGON;
973 /* if (is_scroll) msg_print("You hate dragons.");*/
976 o_ptr->art_flags1 |= TR1_KILL_DRAGON;
977 /* if (is_scroll) msg_print("You feel an intense hatred of dragons.");*/
981 if (o_ptr->tval == TV_SWORD)
983 o_ptr->art_flags1 |= TR1_VORPAL;
984 /* if (is_scroll) msg_print("It looks extremely sharp!");*/
985 if (!artifact_bias && (randint(9) == 1))
986 artifact_bias = BIAS_WARRIOR;
989 random_slay(o_ptr, is_scroll);
992 o_ptr->art_flags1 |= TR1_IMPACT;
993 /* if (is_scroll) msg_print("The ground trembles beneath you.");*/
997 o_ptr->art_flags1 |= TR1_BRAND_FIRE;
998 /* if (is_scroll) msg_print("It feels hot!");*/
1000 artifact_bias = BIAS_FIRE;
1004 o_ptr->art_flags1 |= TR1_BRAND_COLD;
1005 /* if (is_scroll) msg_print("It feels cold!");*/
1007 artifact_bias = BIAS_COLD;
1011 o_ptr->art_flags1 |= TR1_BRAND_ELEC;
1012 /* if (is_scroll) msg_print("Ouch! You get zapped!");*/
1014 artifact_bias = BIAS_ELEC;
1018 o_ptr->art_flags1 |= TR1_BRAND_ACID;
1019 /* if (is_scroll) msg_print("Its smell makes you feel dizzy.");*/
1021 artifact_bias = BIAS_ACID;
1025 o_ptr->art_flags1 |= TR1_BRAND_POIS;
1026 /* if (is_scroll) msg_print("It smells rotten.");*/
1027 if (!artifact_bias && (randint(3) != 1))
1028 artifact_bias = BIAS_POIS;
1029 else if (!artifact_bias && randint(6) == 1)
1030 artifact_bias = BIAS_NECROMANTIC;
1031 else if (!artifact_bias)
1032 artifact_bias = BIAS_ROGUE;
1035 o_ptr->art_flags1 |= TR1_VAMPIRIC;
1036 /* if (is_scroll) msg_print("You think it bit you!");*/
1038 artifact_bias = BIAS_NECROMANTIC;
1041 o_ptr->art_flags1 |= TR1_FORCE_WEPON;
1042 /* if (is_scroll) msg_print("It looks consuming your MP!");*/
1044 artifact_bias = ((randint(2)==1) ? BIAS_MAGE : BIAS_PRIESTLY);
1047 o_ptr->art_flags1 |= TR1_CHAOTIC;
1048 /* if (is_scroll) msg_print("It looks very confusing.");*/
1050 artifact_bias = BIAS_CHAOS;
1061 o_ptr->art_flags3 |= TR3_XTRA_MIGHT;
1062 if (!one_in_(7)) o_ptr->art_flags3 &= ~(TR3_XTRA_SHOTS);
1063 /* if (is_scroll) msg_print("It looks mightier than before."); */
1064 if (!artifact_bias && randint(9) == 1)
1065 artifact_bias = BIAS_RANGER;
1068 o_ptr->art_flags3 |= TR3_XTRA_SHOTS;
1069 if (!one_in_(7)) o_ptr->art_flags3 &= ~(TR3_XTRA_MIGHT);
1070 /* if (is_scroll) msg_print("It seems faster!"); */
1071 if (!artifact_bias && randint(9) == 1)
1072 artifact_bias = BIAS_RANGER;
1079 static void give_activation_power(object_type *o_ptr)
1081 int type = 0, chance = 0;
1085 if (artifact_bias == BIAS_ELEC)
1087 if (randint(3) != 1)
1089 type = ACT_BO_ELEC_1;
1091 else if (randint(5) != 1)
1093 type = ACT_BA_ELEC_2;
1097 type = ACT_BA_ELEC_3;
1101 else if (artifact_bias == BIAS_POIS)
1103 type = ACT_BA_POIS_1;
1106 else if (artifact_bias == BIAS_FIRE)
1108 if (randint(3) != 1)
1110 type = ACT_BO_FIRE_1;
1112 else if (randint(5) != 1)
1114 type = ACT_BA_FIRE_1;
1118 type = ACT_BA_FIRE_2;
1122 else if (artifact_bias == BIAS_COLD)
1125 if (randint(3) != 1)
1126 type = ACT_BO_COLD_1;
1127 else if (randint(3) != 1)
1128 type = ACT_BA_COLD_1;
1129 else if (randint(3) != 1)
1130 type = ACT_BA_COLD_2;
1132 type = ACT_BA_COLD_3;
1134 else if (artifact_bias == BIAS_CHAOS)
1137 if (randint(6) == 1)
1138 type = ACT_SUMMON_DEMON;
1140 type = ACT_CALL_CHAOS;
1142 else if (artifact_bias == BIAS_PRIESTLY)
1146 if (randint(13) == 1)
1147 type = ACT_CHARM_UNDEAD;
1148 else if (randint(12) == 1)
1149 type = ACT_BANISH_EVIL;
1150 else if (randint(11) == 1)
1151 type = ACT_DISP_EVIL;
1152 else if (randint(10) == 1)
1153 type = ACT_PROT_EVIL;
1154 else if (randint(9) == 1)
1155 type = ACT_CURE_1000;
1156 else if (randint(8) == 1)
1157 type = ACT_CURE_700;
1158 else if (randint(7) == 1)
1159 type = ACT_REST_ALL;
1160 else if (randint(6) == 1)
1161 type = ACT_REST_LIFE;
1165 else if (artifact_bias == BIAS_NECROMANTIC)
1168 if (randint(66) == 1)
1170 else if (randint(13) == 1)
1171 type = ACT_DISP_GOOD;
1172 else if (randint(9) == 1)
1173 type = ACT_MASS_GENO;
1174 else if (randint(8) == 1)
1175 type = ACT_GENOCIDE;
1176 else if (randint(13) == 1)
1177 type = ACT_SUMMON_UNDEAD;
1178 else if (randint(9) == 1)
1179 type = ACT_VAMPIRE_2;
1180 else if (randint(6) == 1)
1181 type = ACT_CHARM_UNDEAD;
1183 type = ACT_VAMPIRE_1;
1185 else if (artifact_bias == BIAS_LAW)
1188 if (randint(8) == 1)
1189 type = ACT_BANISH_EVIL;
1190 else if (randint(4) == 1)
1191 type = ACT_DISP_EVIL;
1193 type = ACT_PROT_EVIL;
1195 else if (artifact_bias == BIAS_ROGUE)
1198 if (randint(50) == 1)
1200 else if (randint(4) == 1)
1202 else if (randint(3) == 1)
1203 type = ACT_DETECT_ALL;
1204 else if (randint(8) == 1)
1207 type = ACT_ID_PLAIN;
1209 else if (artifact_bias == BIAS_MAGE)
1212 if (randint(20) == 1)
1213 type = ACT_SUMMON_ELEMENTAL;
1214 else if (randint(10) == 1)
1215 type = ACT_SUMMON_PHANTOM;
1216 else if (randint(5) == 1)
1217 type = ACT_RUNE_EXPLO;
1221 else if (artifact_bias == BIAS_WARRIOR)
1224 if (randint(100) == 1)
1229 else if (artifact_bias == BIAS_RANGER)
1232 if (randint(20) == 1)
1233 type = ACT_CHARM_ANIMALS;
1234 else if (randint(7) == 1)
1235 type = ACT_SUMMON_ANIMAL;
1236 else if (randint(6) == 1)
1237 type = ACT_CHARM_ANIMAL;
1238 else if (randint(4) == 1)
1239 type = ACT_RESIST_ALL;
1240 else if (randint(3) == 1)
1243 type = ACT_CURE_POISON;
1247 while (!type || (randint(100) >= chance))
1249 type = randint(255);
1264 case ACT_CURE_POISON:
1278 case ACT_RESIST_ALL:
1279 case ACT_DETECT_ALL:
1301 case ACT_CHARM_ANIMAL:
1304 case ACT_SUMMON_ANIMAL:
1310 case ACT_BANISH_EVIL:
1313 case ACT_CHARM_UNDEAD:
1314 case ACT_CHARM_OTHER:
1315 case ACT_SUMMON_PHANTOM:
1317 case ACT_RUNE_EXPLO:
1320 case ACT_CALL_CHAOS:
1322 case ACT_CHARM_ANIMALS:
1323 case ACT_CHARM_OTHERS:
1324 case ACT_SUMMON_ELEMENTAL:
1332 case ACT_XTRA_SPEED:
1333 case ACT_DETECT_XTRA:
1337 case ACT_SUMMON_UNDEAD:
1338 case ACT_SUMMON_DEMON:
1349 /* A type was chosen... */
1350 o_ptr->xtra2 = type;
1351 o_ptr->art_flags3 |= TR3_ACTIVATE;
1356 static void get_random_name(char *return_name, bool armour, int power)
1358 if (randint(100) <= TABLE_NAME)
1360 get_table_name(return_name);
1373 filename = "a_cursed_j.txt";
1375 filename = "a_cursed.txt";
1381 filename = "a_low_j.txt";
1383 filename = "a_low.txt";
1389 filename = "a_med_j.txt";
1391 filename = "a_med.txt";
1397 filename = "a_high_j.txt";
1399 filename = "a_high.txt";
1409 filename = "w_cursed_j.txt";
1411 filename = "w_cursed.txt";
1417 filename = "w_low_j.txt";
1419 filename = "w_low.txt";
1425 filename = "w_med_j.txt";
1427 filename = "w_med.txt";
1433 filename = "w_high_j.txt";
1435 filename = "w_high.txt";
1441 (void)get_rnd_line(filename, artifact_bias, return_name);
1443 if(return_name[0]==0)get_table_name(return_name);
1449 bool create_artifact(object_type *o_ptr, bool a_scroll)
1451 char new_name[1024];
1453 int powers = randint(5) + 1;
1454 int max_type = (o_ptr->tval < TV_BOOTS ? 7 : 5);
1457 bool a_cursed = FALSE;
1458 int warrior_artifact_bias = 0;
1463 /* Nuke enchantments */
1467 o_ptr->art_flags1 |= k_info[o_ptr->k_idx].flags1;
1468 o_ptr->art_flags2 |= k_info[o_ptr->k_idx].flags2;
1469 o_ptr->art_flags3 |= k_info[o_ptr->k_idx].flags3;
1470 if (o_ptr->pval) has_pval = TRUE;
1472 if (a_scroll && (randint(4) == 1))
1474 switch (p_ptr->pclass)
1477 case CLASS_BERSERKER:
1482 artifact_bias = BIAS_WARRIOR;
1485 case CLASS_HIGH_MAGE:
1486 case CLASS_SORCERER:
1487 case CLASS_MAGIC_EATER:
1488 case CLASS_BLUE_MAGE:
1489 artifact_bias = BIAS_MAGE;
1492 artifact_bias = BIAS_PRIESTLY;
1496 artifact_bias = BIAS_ROGUE;
1497 warrior_artifact_bias = 25;
1500 case CLASS_MIRROR_MASTER:
1501 artifact_bias = BIAS_RANGER;
1502 warrior_artifact_bias = 30;
1505 artifact_bias = BIAS_PRIESTLY;
1506 warrior_artifact_bias = 40;
1508 case CLASS_WARRIOR_MAGE:
1509 case CLASS_RED_MAGE:
1510 artifact_bias = BIAS_MAGE;
1511 warrior_artifact_bias = 40;
1513 case CLASS_CHAOS_WARRIOR:
1514 artifact_bias = BIAS_CHAOS;
1515 warrior_artifact_bias = 40;
1518 case CLASS_FORCETRAINER:
1519 artifact_bias = BIAS_PRIESTLY;
1521 case CLASS_MINDCRAFTER:
1523 if (randint(5) > 2) artifact_bias = BIAS_PRIESTLY;
1526 if (randint(5) > 2) artifact_bias = BIAS_WARRIOR;
1528 case CLASS_IMITATOR:
1529 if (randint(2) > 1) artifact_bias = BIAS_RANGER;
1531 case CLASS_BEASTMASTER:
1532 artifact_bias = BIAS_CHR;
1533 warrior_artifact_bias = 50;
1538 if (a_scroll && (randint(100) <= warrior_artifact_bias))
1539 artifact_bias = BIAS_WARRIOR;
1541 strcpy(new_name, "");
1543 if (!a_scroll && (randint(A_CURSED) == 1))
1545 if (((o_ptr->tval == TV_AMULET) || (o_ptr->tval == TV_RING)) && cursed_p(o_ptr))
1548 while ((randint(powers) == 1) || (randint(7) == 1) || (randint(10) == 1))
1551 if (!a_cursed && (randint(WEIRD_LUCK) == 1))
1554 if (a_cursed) powers /= 2;
1559 switch (randint(max_type))
1562 random_plus(o_ptr, a_scroll);
1566 if (one_in_(2) && (o_ptr->tval < TV_BOOTS) && (o_ptr->tval != TV_BOW))
1568 if (a_cursed && !one_in_(13)) break;
1571 if (one_in_(o_ptr->ds+4)) o_ptr->ds++;
1575 if (one_in_(o_ptr->dd+1)) o_ptr->dd++;
1579 random_resistance(o_ptr, a_scroll, FALSE);
1582 random_misc(o_ptr, a_scroll);
1585 random_slay(o_ptr, a_scroll);
1588 if (wizard) msg_print("Switch error in create_artifact!");
1596 o_ptr->art_flags3 |= TR3_SHOW_MODS;
1598 /* This one commented out by gw's request... */
1600 o_ptr->art_flags3 |= TR3_HIDE_TYPE;
1603 if (o_ptr->art_flags1 & TR1_BLOWS)
1605 o_ptr->pval = randint(2);
1606 if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_HAYABUSA))
1615 while (o_ptr->pval < randint(5) || randint(o_ptr->pval) == 1);
1618 if ((o_ptr->pval > 4) && (randint(WEIRD_LUCK) != 1))
1622 /* give it some plusses... */
1623 if (o_ptr->tval >= TV_BOOTS && o_ptr->tval <= TV_DRAG_ARMOR)
1624 o_ptr->to_a += randint(o_ptr->to_a > 19 ? 1 : 20 - o_ptr->to_a);
1625 else if (o_ptr->tval <= TV_SWORD)
1627 o_ptr->to_h += randint(o_ptr->to_h > 19 ? 1 : 20 - o_ptr->to_h);
1628 o_ptr->to_d += randint(o_ptr->to_d > 19 ? 1 : 20 - o_ptr->to_d);
1629 if ((o_ptr->art_flags1 & TR1_WIS) && (o_ptr->pval > 0)) o_ptr->art_flags3 |= TR3_BLESSED;
1632 /* Just to be sure */
1633 o_ptr->art_flags3 |= (TR3_IGNORE_ACID | TR3_IGNORE_ELEC |
1634 TR3_IGNORE_FIRE | TR3_IGNORE_COLD);
1636 total_flags = flag_cost(o_ptr, o_ptr->pval);
1637 if (cheat_peek) msg_format("%ld", total_flags);
1639 if (a_cursed) curse_artifact(o_ptr);
1642 (randint((o_ptr->tval >= TV_BOOTS)
1643 ? ACTIVATION_CHANCE * 2 : ACTIVATION_CHANCE) == 1))
1646 give_activation_power(o_ptr);
1649 if ((o_ptr->tval >= TV_BOOTS) && (o_ptr->tval <= TV_DRAG_ARMOR))
1651 while ((o_ptr->to_d+o_ptr->to_h) > 20)
1653 if (one_in_(o_ptr->to_d) && one_in_(o_ptr->to_h)) break;
1654 o_ptr->to_d -= rand_int(3);
1655 o_ptr->to_h -= rand_int(3);
1657 while ((o_ptr->to_d+o_ptr->to_h) > 10)
1659 if (one_in_(o_ptr->to_d) || one_in_(o_ptr->to_h)) break;
1660 o_ptr->to_d -= rand_int(3);
1661 o_ptr->to_h -= rand_int(3);
1665 if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI))
1669 o_ptr->art_flags1 &= ~(TR1_BLOWS);
1670 o_ptr->art_flags1 &= ~(TR1_FORCE_WEPON);
1671 o_ptr->art_flags1 &= ~(TR1_SLAY_ANIMAL);
1672 o_ptr->art_flags1 &= ~(TR1_SLAY_EVIL);
1673 o_ptr->art_flags1 &= ~(TR1_SLAY_UNDEAD);
1674 o_ptr->art_flags1 &= ~(TR1_SLAY_DEMON);
1675 o_ptr->art_flags1 &= ~(TR1_SLAY_ORC);
1676 o_ptr->art_flags1 &= ~(TR1_SLAY_TROLL);
1677 o_ptr->art_flags1 &= ~(TR1_SLAY_GIANT);
1678 o_ptr->art_flags1 &= ~(TR1_SLAY_DRAGON);
1679 o_ptr->art_flags1 &= ~(TR1_KILL_DRAGON);
1680 o_ptr->art_flags1 &= ~(TR1_VORPAL);
1681 o_ptr->art_flags1 &= ~(TR1_BRAND_POIS);
1682 o_ptr->art_flags1 &= ~(TR1_BRAND_ACID);
1683 o_ptr->art_flags1 &= ~(TR1_BRAND_ELEC);
1684 o_ptr->art_flags1 &= ~(TR1_BRAND_FIRE);
1685 o_ptr->art_flags1 &= ~(TR1_BRAND_COLD);
1688 if (o_ptr->tval >= TV_BOOTS)
1690 if (a_cursed) power_level = 0;
1691 else if (total_flags < 15000) power_level = 1;
1692 else if (total_flags < 25000) power_level = 2;
1693 else power_level = 3;
1698 if (a_cursed) power_level = 0;
1699 else if (total_flags < 20000) power_level = 1;
1700 else if (total_flags < 35000) power_level = 2;
1701 else power_level = 3;
1706 char dummy_name[80];
1707 strcpy(dummy_name, "");
1708 (void)identify_fully_aux(o_ptr);
1711 if (!(get_string("¤³¤Î¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È¤ò²¿¤È̾ÉÕ¤±¤Þ¤¹¤«¡©", dummy_name, 80)))
1713 if (!(get_string("What do you want to call the artifact? ", dummy_name, 80)))
1717 get_random_name(new_name, (bool)(o_ptr->tval >= TV_BOOTS), power_level);
1722 strcpy(new_name, "¡Ô");
1724 strcpy(new_name, "'");
1727 strcat(new_name, dummy_name);
1729 strcat(new_name, "¡Õ¤È¤¤¤¦Ì¾¤Î");
1731 strcat(new_name, "'");
1735 /* Identify it fully */
1736 object_aware(o_ptr);
1737 object_known(o_ptr);
1739 /* Mark the item as fully known */
1740 o_ptr->ident |= (IDENT_MENTAL);
1742 chg_virtue(V_INDIVIDUALISM, 2);
1743 chg_virtue(V_ENCHANT, 5);
1748 get_random_name(new_name, (bool)(o_ptr->tval >= TV_BOOTS), power_level);
1755 msg_format("±¿¤ÎÊФä¿¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È: %d¡£", artifact_bias);
1757 msg_format("Biased artifact: %d.", artifact_bias);
1762 msg_print("¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È¤Ë±¿¤ÎÊФê¤Ê¤·¡£");
1764 msg_print("No bias in artifact.");
1769 /* Save the inscription */
1770 o_ptr->art_name = quark_add(new_name);
1773 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1779 bool activate_random_artifact(object_type * o_ptr)
1781 int plev = p_ptr->lev;
1782 int k, dir, dummy = 0;
1784 if (!o_ptr->art_name) return FALSE; /* oops? */
1786 /* Activate for attack */
1787 switch (o_ptr->xtra2)
1791 if (!get_aim_dir(&dir)) return FALSE;
1793 msg_print("ÂÀÍÛ¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
1795 msg_print("A line of sunlight appears.");
1798 (void)lite_line(dir);
1799 o_ptr->timeout = 10;
1806 msg_print("¤½¤ì¤ÏâÁ¤·¤¤¤¯¤é¤¤¤ËÌÀ¤ë¤¯µ±¤¤¤Æ¤¤¤ë...");
1808 msg_print("It glows extremely brightly...");
1811 if (!get_aim_dir(&dir)) return FALSE;
1812 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
1820 msg_print("¤½¤ì¤ÏÇ»Î理Ë̮ư¤·¤Æ¤¤¤ë...");
1822 msg_print("It throbs deep green...");
1825 if (!get_aim_dir(&dir)) return FALSE;
1826 fire_ball(GF_POIS, dir, 12, 3);
1827 o_ptr->timeout = rand_int(4) + 4;
1834 msg_print("¤½¤ì¤Ï²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
1836 msg_print("It is covered in sparks...");
1839 if (!get_aim_dir(&dir)) return FALSE;
1840 fire_bolt(GF_ELEC, dir, damroll(4, 8));
1841 o_ptr->timeout = rand_int(5) + 5;
1848 msg_print("¤½¤ì¤Ï»À¤Ëʤ¤ï¤ì¤¿...");
1850 msg_print("It is covered in acid...");
1853 if (!get_aim_dir(&dir)) return FALSE;
1854 fire_bolt(GF_ACID, dir, damroll(5, 8));
1855 o_ptr->timeout = rand_int(6) + 6;
1862 msg_print("¤½¤ì¤ÏÁú¤Ëʤ¤ï¤ì¤¿...");
1864 msg_print("It is covered in frost...");
1867 if (!get_aim_dir(&dir)) return FALSE;
1868 fire_bolt(GF_COLD, dir, damroll(6, 8));
1869 o_ptr->timeout = rand_int(7) + 7;
1876 msg_print("¤½¤ì¤Ï±ê¤Ëʤ¤ï¤ì¤¿...");
1878 msg_print("It is covered in fire...");
1881 if (!get_aim_dir(&dir)) return FALSE;
1882 fire_bolt(GF_FIRE, dir, damroll(9, 8));
1883 o_ptr->timeout = rand_int(8) + 8;
1890 msg_print("¤½¤ì¤ÏÁú¤Ëʤ¤ï¤ì¤¿...");
1892 msg_print("It is covered in frost...");
1895 if (!get_aim_dir(&dir)) return FALSE;
1896 fire_ball(GF_COLD, dir, 48, 2);
1897 o_ptr->timeout = 400;
1904 msg_print("¤½¤ì¤ÏÀÖ¤¯·ã¤·¤¯µ±¤¤¤¿...");
1906 msg_print("It glows an intense red...");
1909 if (!get_aim_dir(&dir)) return FALSE;
1910 fire_ball(GF_FIRE, dir, 72, 2);
1911 o_ptr->timeout = 400;
1918 msg_print("¤½¤ì¤Ï¹õ¤¯µ±¤¤¤¿...");
1920 msg_print("It glows black...");
1923 if (!get_aim_dir(&dir)) return FALSE;
1924 if (drain_life(dir, 100))
1925 o_ptr->timeout = rand_int(100) + 100;
1932 msg_print("¤½¤ì¤ÏÀĤ¯·ã¤·¤¯µ±¤¤¤¿...");
1934 msg_print("It glows an intense blue...");
1937 if (!get_aim_dir(&dir)) return FALSE;
1938 fire_ball(GF_COLD, dir, 100, 2);
1939 o_ptr->timeout = 300;
1946 msg_print("Åŵ¤¤¬¥Ñ¥Á¥Ñ¥Á²»¤òΩ¤Æ¤¿...");
1948 msg_print("It crackles with electricity...");
1951 if (!get_aim_dir(&dir)) return FALSE;
1952 fire_ball(GF_ELEC, dir, 100, 3);
1953 o_ptr->timeout = 500;
1960 msg_print("¹õ¤¯µ±¤¤¤Æ¤¤¤ë...");
1962 msg_print("It glows black...");
1965 if (!get_aim_dir(&dir)) return FALSE;
1966 drain_life(dir, 120);
1967 o_ptr->timeout = 400;
1973 if (!get_aim_dir(&dir)) return FALSE;
1974 for (dummy = 0; dummy < 3; dummy++)
1976 if (drain_life(dir, 50))
1979 o_ptr->timeout = 400;
1986 msg_print("ËâË¡¤Î¥È¥²¤¬¸½¤ì¤¿...");
1988 msg_print("It grows magical spikes...");
1991 if (!get_aim_dir(&dir)) return FALSE;
1992 fire_bolt(GF_ARROW, dir, 150);
1993 o_ptr->timeout = rand_int(90) + 90;
2000 msg_print("¿¼ÀÖ¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2002 msg_print("It glows deep red...");
2005 if (!get_aim_dir(&dir)) return FALSE;
2006 fire_ball(GF_FIRE, dir, 120, 3);
2007 o_ptr->timeout = rand_int(225) + 225;
2014 msg_print("ÌÀ¤ë¤¯Çò¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2016 msg_print("It glows bright white...");
2019 if (!get_aim_dir(&dir)) return FALSE;
2020 fire_ball(GF_COLD, dir, 200, 3);
2021 o_ptr->timeout = rand_int(325) + 325;
2028 msg_print("¿¼ÀÄ¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2030 msg_print("It glows deep blue...");
2033 if (!get_aim_dir(&dir)) return FALSE;
2034 fire_ball(GF_ELEC, dir, 250, 3);
2035 o_ptr->timeout = rand_int(425) + 425;
2044 monster_type *m_ptr;
2046 for (dir = 0; dir <= 9; dir++)
2050 c_ptr = &cave[y][x];
2052 /* Get the monster */
2053 m_ptr = &m_list[c_ptr->m_idx];
2055 /* Hack -- attack monsters */
2056 if (c_ptr->m_idx && (m_ptr->ml || cave_floor_bold(y, x)))
2060 o_ptr->timeout = 250;
2066 if (!get_aim_dir(&dir)) return FALSE;
2067 for (dummy = 0; dummy < 3; dummy++)
2069 if (drain_life(dir, 100))
2073 o_ptr->timeout = 400;
2078 case ACT_CALL_CHAOS:
2081 msg_print("ÍÍ¡¹¤Ê¿§¤Î²Ð²Ö¤òȯ¤·¤Æ¤¤¤ë...");
2083 msg_print("It glows in scintillating colours...");
2087 o_ptr->timeout = 350;
2093 if (!get_aim_dir(&dir)) return FALSE;
2095 msg_print("¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡ª");
2097 msg_print("You launch a rocket!");
2100 fire_ball(GF_ROCKET, dir, 120 + plev, 2);
2101 o_ptr->timeout = 400;
2108 msg_print("¿ÀÀ»¤ÊÊ·°Ïµ¤¤¬½¼Ëþ¤·¤¿...");
2110 msg_print("It floods the area with goodness...");
2113 dispel_evil(p_ptr->lev * 5);
2114 o_ptr->timeout = rand_int(300) + 300;
2121 msg_print("¼Ù°¤ÊÊ·°Ïµ¤¤¬½¼Ëþ¤·¤¿...");
2123 msg_print("It floods the area with evil...");
2126 dispel_good(p_ptr->lev * 5);
2127 o_ptr->timeout = rand_int(300) + 300;
2133 if (!get_aim_dir(&dir)) return FALSE;
2135 msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
2137 msg_print("You breathe the elements.");
2140 fire_ball(GF_MISSILE, dir, 300, 4);
2141 o_ptr->timeout = 500;
2145 /* Activate for other offensive action */
2150 msg_print("ÍÍ¡¹¤Ê¿§¤Î²Ð²Ö¤òȯ¤·¤Æ¤¤¤ë...");
2152 msg_print("It glows in scintillating colours...");
2155 if (!get_aim_dir(&dir)) return FALSE;
2156 confuse_monster(dir, 20);
2157 o_ptr->timeout = 15;
2164 msg_print("¿¼ÀÄ¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2166 msg_print("It glows deep blue...");
2169 sleep_monsters_touch();
2170 o_ptr->timeout = 55;
2176 earthquake(py, px, 10);
2177 o_ptr->timeout = 50;
2183 turn_monsters(40 + p_ptr->lev);
2184 o_ptr->timeout = 3 * (p_ptr->lev + 10);
2190 if (!get_aim_dir(&dir)) return FALSE;
2191 (void)fire_beam(GF_AWAY_ALL, dir, plev);
2192 o_ptr->timeout = 200;
2196 case ACT_BANISH_EVIL:
2198 if (banish_evil(100))
2201 msg_print("¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È¤ÎÎϤ¬¼Ù°¤òÂǤÁÅݤ·¤¿¡ª");
2203 msg_print("The power of the artifact banishes evil!");
2207 o_ptr->timeout = 250 + randint(250);
2214 msg_print("¿¼ÀÄ¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2216 msg_print("It glows deep blue...");
2219 (void)symbol_genocide(200, TRUE);
2220 o_ptr->timeout = 500;
2227 msg_print("¤Ò¤É¤¯±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
2229 msg_print("It lets out a long, shrill note...");
2232 (void)mass_genocide(200, TRUE);
2233 o_ptr->timeout = 1000;
2237 /* Activate for summoning / charming */
2239 case ACT_CHARM_ANIMAL:
2241 if (!get_aim_dir(&dir)) return FALSE;
2242 (void)charm_animal(dir, plev);
2243 o_ptr->timeout = 300;
2247 case ACT_CHARM_UNDEAD:
2249 if (!get_aim_dir(&dir)) return FALSE;
2250 (void)control_one_undead(dir, plev);
2251 o_ptr->timeout = 333;
2255 case ACT_CHARM_OTHER:
2257 if (!get_aim_dir(&dir)) return FALSE;
2258 (void)charm_monster(dir, plev);
2259 o_ptr->timeout = 400;
2263 case ACT_CHARM_ANIMALS:
2265 (void)charm_animals(plev * 2);
2266 o_ptr->timeout = 500;
2270 case ACT_CHARM_OTHERS:
2272 charm_monsters(plev * 2);
2273 o_ptr->timeout = 750;
2277 case ACT_SUMMON_ANIMAL:
2279 (void)summon_specific(-1, py, px, plev, SUMMON_ANIMAL_RANGER, TRUE, TRUE, TRUE, FALSE, FALSE);
2280 o_ptr->timeout = 200 + randint(300);
2284 case ACT_SUMMON_PHANTOM:
2287 msg_print("¸¸Îî¤ò¾¤´¤·¤¿¡£");
2289 msg_print("You summon a phantasmal servant.");
2292 (void)summon_specific(-1, py, px, dun_level, SUMMON_PHANTOM, TRUE, TRUE, TRUE, FALSE, FALSE);
2293 o_ptr->timeout = 200 + randint(200);
2297 case ACT_SUMMON_ELEMENTAL:
2299 bool pet = (randint(3) == 1);
2300 bool group = !(pet && (plev < 50));
2302 if (summon_specific((pet ? -1 : 0), py, px, ((plev * 3) / 2), SUMMON_ELEMENTAL, group, FALSE, pet, FALSE, !pet))
2305 msg_print("¥¨¥ì¥á¥ó¥¿¥ë¤¬¸½¤ì¤¿...");
2307 msg_print("An elemental materializes...");
2313 msg_print("¤¢¤Ê¤¿¤ËÉþ½¾¤·¤Æ¤¤¤ë¤è¤¦¤À¡£");
2315 msg_print("It seems obedient to you.");
2320 msg_print("¤½¤ì¤ò¥³¥ó¥È¥í¡¼¥ë¤Ç¤¤Ê¤«¤Ã¤¿¡ª");
2322 msg_print("You fail to control it!");
2327 o_ptr->timeout = 750;
2331 case ACT_SUMMON_DEMON:
2333 bool pet = (randint(3) == 1);
2334 bool group = !(pet && (plev < 50));
2336 if (summon_specific((pet ? -1 : 0), py, px, ((plev * 3) / 2), SUMMON_DEMON, group, FALSE, pet, FALSE, !pet))
2339 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
2341 msg_print("The area fills with a stench of sulphur and brimstone.");
2346 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
2348 msg_print("'What is thy bidding... Master?'");
2353 msg_print("¡ÖNON SERVIAM! Wretch! ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
2355 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
2360 o_ptr->timeout = 666 + randint(333);
2364 case ACT_SUMMON_UNDEAD:
2366 bool pet = (randint(3) == 1);
2371 type = (plev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
2374 group = (((plev > 24) && (randint(3) == 1)) ? TRUE : FALSE);
2375 unique_okay = FALSE;
2383 if (summon_specific((pet ? -1 : 0), py, px, ((plev * 3) / 2), type,
2384 group, FALSE, pet, unique_okay, !pet))
2387 msg_print("Î䤿¤¤É÷¤¬¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¿á¤»Ï¤á¤¿¡£¤½¤ì¤ÏÉåÇÔ½¤ò±¿¤ó¤Ç¤¤¤ë...");
2389 msg_print("Cold winds begin to blow around you, carrying with them the stench of decay...");
2394 msg_print("¸Å¤¨¤Î»à¤»¤ë¼Ô¶¦¤¬¤¢¤Ê¤¿¤Ë»Å¤¨¤ë¤¿¤áÅÚ¤«¤éᴤä¿¡ª");
2396 msg_print("Ancient, long-dead forms arise from the ground to serve you!");
2401 msg_print("»à¼Ô¤¬á´¤Ã¤¿¡£Ì²¤ê¤ò˸¤²¤ë¤¢¤Ê¤¿¤òȳ¤¹¤ë¤¿¤á¤Ë¡ª");
2403 msg_print("'The dead arise... to punish you for disturbing them!'");
2408 o_ptr->timeout = 666 + randint(333);
2412 /* Activate for healing */
2416 (void)set_afraid(0);
2417 (void)hp_player(30);
2418 o_ptr->timeout = 10;
2425 msg_print("¿¼»ç¿§¤Î¸÷¤òȯ¤·¤Æ¤¤¤ë...");
2427 msg_print("It radiates deep purple...");
2430 hp_player(damroll(4, 8));
2431 (void)set_cut((p_ptr->cut / 2) - 50);
2432 o_ptr->timeout = rand_int(3) + 3;
2436 case ACT_CURE_POISON:
2439 msg_print("¿¼ÀÄ¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2441 msg_print("It glows deep blue...");
2444 (void)set_afraid(0);
2445 (void)set_poisoned(0);
2453 msg_print("¿¼¹È¤Ëµ±¤¤¤Æ¤¤¤ë...");
2455 msg_print("It glows a deep red...");
2459 o_ptr->timeout = 450;
2466 msg_print("Ç»Îп§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2468 msg_print("It glows a deep green...");
2471 (void)do_res_stat(A_STR);
2472 (void)do_res_stat(A_INT);
2473 (void)do_res_stat(A_WIS);
2474 (void)do_res_stat(A_DEX);
2475 (void)do_res_stat(A_CON);
2476 (void)do_res_stat(A_CHR);
2477 (void)restore_level();
2478 o_ptr->timeout = 750;
2485 msg_print("¿¼ÀÄ¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2487 msg_print("It glows deep blue...");
2491 msg_print("ÂÎÆâ¤ËÃȤ«¤¤¸ÝÆ°¤¬´¶¤¸¤é¤ì¤ë...");
2493 msg_print("You feel a warm tingling inside...");
2496 (void)hp_player(700);
2498 o_ptr->timeout = 250;
2505 msg_print("Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤Æ¤¤¤ë...");
2507 msg_print("It glows a bright white...");
2511 msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬¤è¤¤...");
2513 msg_print("You feel much better...");
2516 (void)hp_player(1000);
2518 o_ptr->timeout = 888;
2522 /* Activate for timed effect */
2526 (void)set_tim_esp(randint(30) + 25, FALSE);
2527 o_ptr->timeout = 200;
2533 (void)set_hero(randint(50) + 50, FALSE);
2534 (void)set_blessed(randint(50) + 50, FALSE);
2535 o_ptr->timeout = 100 + randint(100);
2542 msg_print("±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
2544 msg_print("It lets out a shrill wail...");
2548 (void)set_protevil(randint(25) + k, FALSE);
2549 o_ptr->timeout = rand_int(225) + 225;
2553 case ACT_RESIST_ALL:
2556 msg_print("ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2558 msg_print("It glows many colours...");
2561 (void)set_oppose_acid(randint(40) + 40, FALSE);
2562 (void)set_oppose_elec(randint(40) + 40, FALSE);
2563 (void)set_oppose_fire(randint(40) + 40, FALSE);
2564 (void)set_oppose_cold(randint(40) + 40, FALSE);
2565 (void)set_oppose_pois(randint(40) + 40, FALSE);
2566 o_ptr->timeout = 200;
2573 msg_print("ÌÀ¤ë¤¯Îп§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2575 msg_print("It glows bright green...");
2578 (void)set_fast(randint(20) + 20, FALSE);
2579 o_ptr->timeout = 250;
2583 case ACT_XTRA_SPEED:
2586 msg_print("ÌÀ¤ë¤¯µ±¤¤¤Æ¤¤¤ë...");
2588 msg_print("It glows brightly...");
2591 (void)set_fast(randint(75) + 75, FALSE);
2592 o_ptr->timeout = rand_int(200) + 200;
2598 set_wraith_form(randint(plev / 2) + (plev / 2), FALSE);
2599 o_ptr->timeout = 1000;
2605 (void)set_invuln(randint(8) + 8, FALSE);
2606 o_ptr->timeout = 1000;
2610 /* Activate for general purpose effect (detection etc.) */
2615 msg_print("À¡¤ó¤À¸÷¤¬¤¢¤Õ¤ì½Ð¤¿...");
2617 msg_print("It wells with clear light...");
2620 lite_area(damroll(2, 15), 3);
2621 o_ptr->timeout = rand_int(10) + 10;
2628 msg_print("âÁ¤·¤¯µ±¤¤¤¿...");
2630 msg_print("It shines brightly...");
2633 map_area(DETECT_RAD_MAP);
2634 lite_area(damroll(2, 15), 3);
2635 o_ptr->timeout = rand_int(50) + 50;
2639 case ACT_DETECT_ALL:
2642 msg_print("Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤Æ¤¤¤ë...");
2644 msg_print("It glows bright white...");
2648 msg_print("¿´¤Ë¥¤¥á¡¼¥¸¤¬É⤫¤ó¤Ç¤¤¿...");
2650 msg_print("An image forms in your mind...");
2653 detect_all(DETECT_RAD_DEFAULT);
2654 o_ptr->timeout = rand_int(55) + 55;
2658 case ACT_DETECT_XTRA:
2661 msg_print("ÌÀ¤ë¤¯µ±¤¤¤Æ¤¤¤ë...");
2663 msg_print("It glows brightly...");
2666 detect_all(DETECT_RAD_DEFAULT);
2668 identify_fully(FALSE);
2669 o_ptr->timeout = 1000;
2676 msg_print("²«¿§¤¯µ±¤¤¤Æ¤¤¤ë...");
2678 msg_print("It glows yellow...");
2681 identify_fully(FALSE);
2682 o_ptr->timeout = 750;
2688 if (!ident_spell(FALSE)) return FALSE;
2689 o_ptr->timeout = 10;
2693 case ACT_RUNE_EXPLO:
2696 msg_print("ÌÀ¤ë¤¤ÀÖ¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2698 msg_print("It glows bright red...");
2702 o_ptr->timeout = 200;
2709 msg_print("¥Ö¥ë¡¼¤ËÌÀ¤ë¤¯µ±¤¤¤Æ¤¤¤ë...");
2711 msg_print("It glows light blue...");
2715 o_ptr->timeout = 400;
2721 (void)set_food(PY_FOOD_MAX - 1);
2722 o_ptr->timeout = 200;
2729 msg_print("ÌÀ¤ë¤¤ÀÖ¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2731 msg_print("It glows bright red...");
2734 destroy_doors_touch();
2735 o_ptr->timeout = 10;
2742 msg_print("¸ÝÆ°¤·¤Æ¤¤¤ë...");
2744 msg_print("It pulsates...");
2747 if (!get_aim_dir(&dir)) return FALSE;
2756 o_ptr->timeout = 70;
2763 msg_print("ÌÀ¤ë¤¤²«¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2765 msg_print("It glows bright yellow...");
2769 o_ptr->timeout = 500;
2776 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
2778 msg_print("You open a dimensional gate. Choose a destination.");
2781 if (!dimension_door()) return FALSE;
2782 o_ptr->timeout = 100;
2790 msg_print("¼þ¤ê¤Î¶õ´Ö¤¬ÏĤó¤Ç¤¤¤ë...");
2792 msg_print("It twists space around you...");
2795 teleport_player(100);
2796 o_ptr->timeout = 45;
2803 msg_print("¤ä¤ï¤é¤«¤ÊÇò¿§¤Ëµ±¤¤¤Æ¤¤¤ë...");
2805 msg_print("It glows soft white...");
2807 if (!word_of_recall()) return FALSE;
2808 o_ptr->timeout = 200;
2815 msg_format("Unknown activation effect: %d.", o_ptr->xtra2);
2817 msg_format("Unknown activation effect: %d.", o_ptr->xtra2);
2828 void random_artifact_resistance(object_type * o_ptr)
2830 bool give_resistance = FALSE, give_power = FALSE;
2832 if (o_ptr->name1 == ART_TERROR) /* Terror Mask is for warriors... */
2834 if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_ARCHER || p_ptr->pclass == CLASS_CAVALRY || p_ptr->pclass == CLASS_BERSERKER)
2837 give_resistance = TRUE;
2841 o_ptr->art_flags3 |=
2842 (TR3_CURSED | TR3_HEAVY_CURSE | TR3_AGGRAVATE | TR3_TY_CURSE);
2843 o_ptr->ident |= IDENT_CURSED;
2847 if (o_ptr->name1 == ART_MURAMASA)
2849 if (p_ptr->pclass != CLASS_SAMURAI)
2851 o_ptr->art_flags3 |= (TR3_NO_TELE | TR3_NO_MAGIC | TR3_HEAVY_CURSE);
2852 o_ptr->ident |= IDENT_CURSED;
2856 if (o_ptr->name1 == ART_XIAOLONG)
2858 if (p_ptr->pclass == CLASS_MONK)
2859 o_ptr->art_flags1 |= TR1_BLOWS;
2862 if (o_ptr->name1 == ART_BLOOD)
2865 dummy = randint(2)+randint(2);
2866 for (i = 0; i < dummy; i++)
2867 o_ptr->art_flags1 |= (TR1_CHAOTIC << rand_int(18));
2869 for (i = 0; i < dummy; i++)
2870 random_resistance(o_ptr, FALSE, randint(34) + 4);
2872 for (i = 0; i < dummy; i++)
2874 int tmp = rand_int(11);
2875 if (tmp < 6) o_ptr->art_flags1 |= (TR1_STR << tmp);
2876 else o_ptr->art_flags1 |= (TR1_STEALTH << (tmp - 6));
2880 switch (o_ptr->name1)
2898 case ART_THALKETTOTH:
2901 /* Give a resistance */
2902 give_resistance = TRUE;
2911 case ART_HARADEKKET:
2917 /* Give a resistance OR a power */
2918 if (randint(2) == 1) give_resistance = TRUE;
2919 else give_power = TRUE;
2940 give_resistance = TRUE;
2947 o_ptr->xtra1 = EGO_XTRA_ABILITY;
2949 /* Randomize the "xtra" power */
2950 if (o_ptr->xtra1) o_ptr->xtra2 = randint(256);
2955 if (give_resistance)
2957 random_resistance(o_ptr, FALSE, randint(22) + 16);
2963 * Create the artifact of the specified number
2965 void create_named_art(int a_idx, int y, int x)
2971 artifact_type *a_ptr = &a_info[a_idx];
2973 /* Get local object */
2976 /* Ignore "empty" artifacts */
2977 if (!a_ptr->name) return;
2979 /* Acquire the "kind" index */
2980 i = lookup_kind(a_ptr->tval, a_ptr->sval);
2985 /* Create the artifact */
2986 object_prep(q_ptr, i);
2989 q_ptr->name1 = a_idx;
2991 /* Extract the fields */
2992 q_ptr->pval = a_ptr->pval;
2993 q_ptr->ac = a_ptr->ac;
2994 q_ptr->dd = a_ptr->dd;
2995 q_ptr->ds = a_ptr->ds;
2996 q_ptr->to_a = a_ptr->to_a;
2997 q_ptr->to_h = a_ptr->to_h;
2998 q_ptr->to_d = a_ptr->to_d;
2999 q_ptr->weight = a_ptr->weight;
3001 /* Hack -- acquire "cursed" flag */
3002 if (a_ptr->flags3 & TR3_CURSED) q_ptr->ident |= (IDENT_CURSED);
3004 random_artifact_resistance(q_ptr);
3008 q_ptr->python = object_create_callback(q_ptr);
3010 #endif /* USE_SCRIPT */
3012 /* Drop the artifact from heaven */
3013 (void)drop_near(q_ptr, -1, y, x);