3 #define MAX_SNIPE_POWERS 16
5 typedef struct snipe_power snipe_power;
13 static const char *snipe_tips[MAX_SNIPE_POWERS] =
16 "Àº¿À¤ò½¸Ã椹¤ë¡£¼Í·â¤Î°ÒÎÏ¡¢ÀºÅÙ¤¬¾å¤¬¤ê¡¢¹âÅ٤ʼͷâ½Ñ¤¬»ÈÍѤǤ¤ë¤è¤¦¤Ë¤Ê¤ë¡£",
17 "¸÷¤ëÌð¤òÊü¤Ä¡£¸÷¤Ë¼å¤¤¥â¥ó¥¹¥¿¡¼¤Ë°ÒÎϤòȯ´ø¤¹¤ë¡£",
18 "¼Í·â¤ò¹Ô¤Ã¤¿¸å¡¢Ã»µ÷Î¥¤Î½Ö´Ö°ÜÆ°¤ò¹Ô¤¦¡£",
19 "µ°Æ»¾å¤Î櫤ò¤¹¤Ù¤Æ̵¸ú¤Ë¤¹¤ëÄã¶õÈô¹Ô¤ÎÌð¤òÊü¤Ä¡£",
20 "²Ð±ê°À¤ÎÌð¤òÊü¤Ä¡£",
21 "ÊɤòÊ´ºÕ¤¹¤ëÌð¤òÊü¤Ä¡£´ä¤Ç¤Ç¤¤¿¥â¥ó¥¹¥¿¡¼¤È̵À¸Êª¤Î¥â¥ó¥¹¥¿¡¼¤Ë°ÒÎϤòȯ´ø¤¹¤ë¡£",
22 "Î䵤°À¤ÎÌð¤òÊü¤Ä¡£",
23 "Ũ¤òÆͤÈô¤Ð¤¹Ìð¤òÊü¤Ä¡£",
24 "Ê£¿ô¤ÎŨ¤ò´ÓÄ̤¹¤ëÌð¤òÊü¤Ä¡£",
25 "Á±Îɤʥâ¥ó¥¹¥¿¡¼¤Ë°ÒÎϤòȯ´ø¤¹¤ëÌð¤òÊü¤Ä¡£",
26 "¼Ù°¤Ê¥â¥ó¥¹¥¿¡¼¤Ë°ÒÎϤòȯ´ø¤¹¤ëÌð¤òÊü¤Ä¡£",
27 "Åö¤¿¤ë¤ÈÇúȯ¤¹¤ëÌð¤òÊü¤Ä¡£",
29 "ÅÅ·â°À¤ÎÌð¤òÊü¤Ä¡£",
30 "Ũ¤ÎµÞ½ê¤Ë¤á¤¬¤±¤ÆÌð¤òÊü¤Ä¡£À®¸ù¤¹¤ë¤ÈŨ¤ò°ì·â»à¤µ¤»¤ë¡£¼ºÇÔ¤¹¤ë¤È1¥À¥á¡¼¥¸¡£",
31 "Á´¤Æ¤Î¥â¥ó¥¹¥¿¡¼¤Ë¹â°ÒÎϤòȯ´ø¤¹¤ëÌð¤òÊü¤Ä¡£È¿Æ°¤Ë¤è¤ëÉû¼¡¸ú²Ì¤ò¼õ¤±¤ë¡£",
33 "Concentrate your mind fot shooting.",
34 "Shot an allow with brightness.",
35 "Blink after shooting.",
36 "Shot an allow able to shatter traps.",
37 "Deals extra damege of fire.",
38 "Shot an allow able to shatter rocks.",
39 "Deals extra damege of ice.",
40 "An allow rushes away a target.",
41 "An allow pierces some monsters.",
42 "Deals more damage to good monsters.",
43 "Deals more damage to evil monsters.",
44 "An allow explodes when it hits a monster.",
46 "Deals extra damege of lightning.",
47 "Deals quick death or 1 damage.",
48 "Deals great damage to all monsters, and some side effects to you.",
52 snipe_power snipe_powers[MAX_SNIPE_POWERS] =
54 /* Level gained, cost, name */
57 { 2, 1, "¥Õ¥é¥Ã¥·¥å¥¢¥í¡¼" },
58 { 3, 1, "¥·¥å¡¼¥È¡õ¥¢¥¦¥§¥¤" },
62 { 13, 2, "Î䵤¤ÎÌð" },
68 { 32, 4, "¥À¥Ö¥ë¥·¥ç¥Ã¥È" },
69 { 36, 3, "¥×¥é¥º¥Þ¥Ü¥ë¥È" },
70 { 40, 3, "¥Ë¡¼¥É¥ë¥·¥ç¥Ã¥È" },
71 { 48, 7, "¥»¥¤¥ó¥È¥¹¥¿¡¼¥¢¥í¡¼" },
73 { 1, 0, "Concentration" },
74 { 2, 1, "Flush Arrow" },
75 { 3, 1, "Shoot & Away" },
76 { 5, 1, "Disarm Shot" },
77 { 8, 2, "Fire Shot" },
78 { 10, 2, "Shatter Arrow" },
79 { 13, 2, "Ice Shot" },
80 { 18, 2, "Rushing Arrow"},
81 { 22, 3, "Piercing Shot" },
82 { 25, 4, "Evil Shot"},
83 { 26, 4, "Holy Shot" },
85 { 32, 4, "Double Shot" },
86 { 36, 3, "Plasma Bolt" },
87 { 40, 3, "Needle Shot" },
88 { 48, 7, "Saint Stars Arrow" },
93 static bool snipe_concentrate(void)
95 if ((int)p_ptr->concent < (2 + (p_ptr->lev + 5) / 10)) p_ptr->concent++;
98 msg_format("½¸Ã椷¤¿¡£(½¸ÃæÅÙ %d)", p_ptr->concent);
100 msg_format("You concentrate deeply. (lvl %d)", p_ptr->concent);
103 reset_concent = FALSE;
105 /* Recalculate bonuses */
106 p_ptr->update |= (PU_BONUS);
108 p_ptr->redraw |= (PR_STATUS);
110 /* Update the monsters */
111 p_ptr->update |= (PU_MONSTERS);
116 void reset_concentration(bool msg)
121 msg_print("½¸ÃæÎϤ¬ÅÓÀÚ¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
123 msg_print("Stop concentrating.");
128 reset_concent = FALSE;
130 /* Recalculate bonuses */
131 p_ptr->update |= (PU_BONUS);
133 p_ptr->redraw |= (PR_STATUS);
135 /* Update the monsters */
136 p_ptr->update |= (PU_MONSTERS);
139 int boost_concentration_damage(int tdam)
141 tdam *= (10 + p_ptr->concent);
147 void display_snipe_list(void)
152 int plev = p_ptr->lev;
156 /* Display a list of spells */
159 put_str("̾Á°", y, x + 5);
160 put_str("Lv MP", y, x + 35);
162 put_str("Name", y, x + 5);
163 put_str("Lv Mana", y, x + 35);
166 /* Dump the spells */
167 for (i = 0; i < MAX_SNIPE_POWERS; i++)
169 /* Access the available spell */
170 spell = snipe_powers[i];
171 if (spell.min_lev > plev) continue;
172 if (spell.mana_cost > (int)p_ptr->concent) continue;
175 sprintf(psi_desc, " %c) %-30s%2d %4d",
176 I2A(i), spell.name, spell.min_lev, spell.mana_cost);
178 Term_putstr(x, y + i + 1, -1, TERM_WHITE, psi_desc);
185 * Allow user to choose a mindcrafter power.
187 * If a valid spell is chosen, saves it in '*sn' and returns TRUE
188 * If the user hits escape, returns FALSE, and set '*sn' to -1
189 * If there are no legal choices, returns FALSE, and sets '*sn' to -2
191 * The "prompt" should be "cast", "recite", or "study"
192 * The "known" should be TRUE for cast/pray, FALSE for study
194 * nb: This function has a (trivial) display bug which will be obvious
195 * when you run it. It's probably easy to fix but I haven't tried,
198 static int get_snipe_power(int *sn, bool only_browse)
204 int plev = p_ptr->lev;
216 #ifdef ALLOW_REPEAT /* TNB */
220 /* Assume cancelled */
223 /* Repeat previous command */
224 /* Get the spell, if available */
227 /* Verify the spell */
228 if ((snipe_powers[*sn].min_lev <= plev) && (snipe_powers[*sn].mana_cost <= (int)p_ptr->concent))
235 #endif /* ALLOW_REPEAT -- TNB */
237 /* Nothing chosen yet */
243 for (i = 0; i < MAX_SNIPE_POWERS; i++)
245 if ((snipe_powers[i].min_lev <= plev) &&
246 ((only_browse) || (snipe_powers[i].mana_cost <= (int)p_ptr->concent)))
252 /* Build a prompt (accept all spells) */
256 (void)strnfmt(out_val, 78, "(%^s %c-%c, '*'¤Ç°ìÍ÷, ESC) ¤É¤Î%s¤Ë¤Ä¤¤¤ÆÃΤê¤Þ¤¹¤«¡©",
258 (void)strnfmt(out_val, 78, "(%^ss %c-%c, *=List, ESC=exit) Use which %s? ",
260 p, I2A(0), I2A(num), p);
265 (void)strnfmt(out_val, 78, "(%^s %c-%c, '*'¤Ç°ìÍ÷, ESC) ¤É¤Î%s¤ò»È¤¤¤Þ¤¹¤«¡©",
267 (void)strnfmt(out_val, 78, "(%^ss %c-%c, *=List, ESC=exit) Use which %s? ",
269 p, I2A(0), I2A(num), p);
272 /* Get a spell from the user */
273 choice = always_show_list ? ESCAPE : 1;
276 if(choice == ESCAPE) choice = ' ';
277 else if( !get_com(out_val, &choice, FALSE) )break;
280 if ((choice == ' ') || (choice == '*') || (choice == '?'))
290 /* Save the screen */
291 if (!only_browse) screen_save();
293 /* Display a list of spells */
296 put_str("̾Á°", y, x + 5);
297 if (only_browse) put_str("Lv ½¸ÃæÅÙ", y, x + 35);
299 put_str("Name", y, x + 5);
300 if (only_browse) put_str("Lv Pow", y, x + 35);
303 /* Dump the spells */
304 for (i = 0; i < MAX_SNIPE_POWERS; i++)
306 Term_erase(x, y + i + 1, 255);
308 /* Access the spell */
309 spell = snipe_powers[i];
310 if (spell.min_lev > plev) continue;
311 if (!only_browse && (spell.mana_cost > (int)p_ptr->concent)) continue;
313 /* Dump the spell --(-- */
315 sprintf(psi_desc, " %c) %-30s%2d %4d",
316 I2A(i), spell.name, spell.min_lev, spell.mana_cost);
318 sprintf(psi_desc, " %c) %-30s", I2A(i), spell.name);
319 prt(psi_desc, y + i + 1, x);
322 /* Clear the bottom line */
323 prt("", y + i + 1, x);
332 /* Restore the screen */
333 if (!only_browse) screen_load();
341 ask = isupper(choice);
344 if (ask) choice = tolower(choice);
346 /* Extract request */
347 i = (islower(choice) ? A2I(choice) : -1);
349 /* Totally Illegal */
350 if ((i < 0) || (i > num) ||
351 (!only_browse &&(snipe_powers[i].mana_cost > (int)p_ptr->concent)))
357 /* Save the spell index */
358 spell = snipe_powers[i];
367 (void) strnfmt(tmp_val, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡©", snipe_powers[i].name);
369 (void)strnfmt(tmp_val, 78, "Use %s? ", snipe_powers[i].name);
372 /* Belay that order */
373 if (!get_check(tmp_val)) continue;
380 /* Restore the screen */
381 if (redraw && !only_browse) screen_load();
384 p_ptr->window |= (PW_SPELL);
389 /* Abort if needed */
390 if (!flag) return (FALSE);
392 /* Save the choice */
395 #ifdef ALLOW_REPEAT /* TNB */
399 #endif /* ALLOW_REPEAT -- TNB */
406 int tot_dam_aux_snipe (int mult, monster_type *m_ptr)
408 monster_race *r_ptr = &r_info[m_ptr->r_idx];
409 bool seen = is_seen(m_ptr);
414 if (r_ptr->flags3 & (RF3_HURT_LITE))
416 int n = 20 + p_ptr->concent;
417 if (seen) r_ptr->r_flags3 |= (RF3_HURT_LITE);
418 if (mult < n) mult = n;
422 if (r_ptr->flagsr & RFR_IM_FIRE)
424 if (seen) r_ptr->r_flagsr |= RFR_IM_FIRE;
428 int n = 15 + (p_ptr->concent * 3);
429 if (mult < n) mult = n;
433 if (r_ptr->flagsr & RFR_IM_COLD)
435 if (seen) r_ptr->r_flagsr |= RFR_IM_COLD;
439 int n = 15 + (p_ptr->concent * 3);
440 if (mult < n) mult = n;
444 if (r_ptr->flagsr & RFR_IM_ELEC)
446 if (seen) r_ptr->r_flagsr |= RFR_IM_ELEC;
450 int n = 18 + (p_ptr->concent * 4);
451 if (mult < n) mult = n;
455 if (r_ptr->flags3 & RF3_HURT_ROCK)
457 int n = 15 + (p_ptr->concent * 2);
458 if (seen) r_ptr->r_flags3 |= RF3_HURT_ROCK;
459 if (mult < n) mult = n;
461 else if (r_ptr->flags3 & RF3_NONLIVING)
463 int n = 15 + (p_ptr->concent * 2);
464 if (seen) r_ptr->r_flags3 |= RF3_NONLIVING;
465 if (mult < n) mult = n;
469 if (r_ptr->flags3 & RF3_GOOD)
471 int n = 15 + (p_ptr->concent * 4);
472 if (seen) r_ptr->r_flags3 |= RF3_GOOD;
473 if (mult < n) mult = n;
477 if (r_ptr->flags3 & RF3_EVIL)
479 int n = 12 + (p_ptr->concent * 3);
480 if (seen) r_ptr->r_flags3 |= RF3_EVIL;
481 if (r_ptr->flags3 & (RF3_HURT_LITE))
483 n += (p_ptr->concent * 3);
484 if (seen) r_ptr->r_flags3 |= (RF3_HURT_LITE);
486 if (mult < n) mult = n;
490 if (mult < 50) mult = 50;
498 * do_cmd_cast calls this function if the player's class
501 static bool cast_sniper_spell(int spell)
503 object_type *o_ptr = &inventory[INVEN_BOW];
505 if (o_ptr->tval != TV_BOW)
508 msg_print("µÝ¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡ª");
510 msg_print("You wield no bow!");
518 case 0: /* Concentration */
519 if (!snipe_concentrate()) return (FALSE);
522 case 1: snipe_type = SP_LITE; break;
523 case 2: snipe_type = SP_AWAY; break;
524 case 3: snipe_type = SP_KILL_TRAP; break;
525 case 4: snipe_type = SP_FIRE; break;
526 case 5: snipe_type = SP_KILL_WALL; break;
527 case 6: snipe_type = SP_COLD; break;
528 case 7: snipe_type = SP_RUSH; break;
529 case 8: snipe_type = SP_PIERCE; break;
530 case 9: snipe_type = SP_EVILNESS; break;
531 case 10: snipe_type = SP_HOLYNESS; break;
532 case 11: snipe_type = SP_EXPLODE; break;
533 case 12: snipe_type = SP_DOUBLE; break;
534 case 13: snipe_type = SP_ELEC; break;
535 case 14: snipe_type = SP_NEEDLE; break;
536 case 15: snipe_type = SP_FINAL; break;
554 * do_cmd_cast calls this function if the player's class
557 void do_cmd_snipe(void)
563 /* not if confused */
567 msg_print("º®Í𤷤Ƥ¤¤Æ½¸Ãæ¤Ç¤¤Ê¤¤¡ª");
569 msg_print("You are too confused!");
574 /* not if hullucinated */
578 msg_print("¸¸³Ð¤¬¸«¤¨¤Æ½¸Ãæ¤Ç¤¤Ê¤¤¡ª");
580 msg_print("You are too hallucinated!");
589 msg_print("Ƭ¤¬Û¯Û°¤È¤·¤Æ¤¤¤Æ½¸Ãæ¤Ç¤¤Ê¤¤¡ª");
591 msg_print("You are too stuned!");
597 if (!get_snipe_power(&n, FALSE)) return;
602 cast = cast_sniper_spell(n);
610 p_ptr->redraw |= (PR_HP | PR_MANA);
613 p_ptr->window |= (PW_PLAYER);
614 p_ptr->window |= (PW_SPELL);
618 * do_cmd_cast calls this function if the player's class
621 void do_cmd_snipe_browse(void)
632 if (!get_snipe_power(&n, TRUE))
638 /* Clear lines, position cursor (really should use strlen here) */
639 Term_erase(12, 22, 255);
640 Term_erase(12, 21, 255);
641 Term_erase(12, 20, 255);
642 Term_erase(12, 19, 255);
643 Term_erase(12, 18, 255);
645 roff_to_buf(snipe_tips[n], 62, temp, sizeof(temp));
646 for(j = 0, line = 19; temp[j]; j += (1 + strlen(&temp[j])))
648 prt(&temp[j], line, 15);