• R/O
  • SSH
  • HTTPS

jband: Commit


Commit MetaInfo

Revision126 (tree)
Time2009-06-26 16:51:41
Authorpaulblay

Log Message

First draft translation of attack.cpp carried out (but not checked). Note that %2$s format was used for variable order parameters in formatted strings - probably needs to be implemented).

Change Summary

Incremental Difference

--- trunk/JBand/src/attack.cpp (revision 125)
+++ trunk/JBand/src/attack.cpp (revision 126)
@@ -4,10 +4,9 @@
44 * - Fixed __T on this page.
55 *
66 * Translation Status:
7- * - Started work on whole phrases on this page.
8- * - plog() done on this page (weren't any).
9- * - prt() done on this page (weren't any).
10- * - msg_print() done on this page.
7+ * - First draft finished on this page.
8+ * - External text tables are also used and those are not translated.
9+ * - Probably will need reworking later to account for different hit verbs.
1110 */
1211 /*
1312 * File: attack.c
@@ -494,6 +493,7 @@
494493 s16b ty, tx;
495494 int tdam, tdis, thits;
496495 int bonus, chance;
496+ _TCHAR langbuf[200];
497497
498498 object_type *o_ptr;
499499 object_type *j_ptr;
@@ -540,7 +540,6 @@
540540 target_get(&tx, &ty);
541541 if (distance(y, x, ty, tx) > tdis)
542542 {
543- _TCHAR langbuf[200];
544543 msg_print(LS(__T("Target out of range"), /* Translation TBC */
545544 spaceme(langbuf, __T("目標が範囲外だ。"))));
546545 return;
@@ -617,7 +616,8 @@
617616 int chance2 = chance - distance(p_ptr->py, p_ptr->px, y, x);
618617 int visible = m_ptr->ml;
619618
620- const _TCHAR *hit_verb = __T("hits");
619+ const _TCHAR *hit_verb = LS(__T("hits"),
620+ spaceme(langbuf, __T("当たった。"))); /* Translation TBC */
621621
622622 int ammo_mult = get_brand_mult(o_ptr, m_ptr,
623623 &hit_verb, TRUE, FALSE);
@@ -632,8 +632,9 @@
632632 {
633633 bool fear = FALSE;
634634
635- /* Assume a default death */
636- const _TCHAR *note_dies = __T(" dies.");
635+ /* Assume a default death */
636+ const _TCHAR *note_dies = LS(__T(" dies."), /* Translation TBC */
637+ spaceme(langbuf,__T("が死んだ")));
637638
638639 /* Some monsters get "destroyed" */
639640 if ((r_ptr->flags[2] & RF2_DEMON) ||
@@ -642,13 +643,15 @@
642643 _tcschr(__T("Evg"), r_ptr->d_char))
643644 {
644645 /* Special note at death */
645- note_dies = __T(" is destroyed.");
646+ note_dies = LS(__T(" is destroyed."), /* Translation TBC */
647+ spaceme(langbuf,__T("が破壊された。")));
646648 }
647649 /* Handle unseen monster */
648650 if (!visible)
649651 {
650652 /* Invisible monster */
651- message_format(MSG_SHOOT_HIT, 0, __T("The %s finds a mark."), o_name);
653+ message_format(MSG_SHOOT_HIT, 0, LS(__T("The %s finds a mark."), /* Translation TBC */
654+ spaceme(langbuf, __T("%s が何かに当たった。"))), o_name);
652655 }
653656 else /* Handle visible monster */
654657 {
@@ -657,8 +660,11 @@
657660 /* Get "the monster" or "it" */
658661 monster_desc(m_name, _countof(m_name), m_ptr, 0);
659662
660- /* Message */
661- message_format(MSG_SHOOT_HIT, 0, __T("The %s %s %s."), o_name, hit_verb, m_name);
663+ /* Message */ /* The arrow hits the monster */
664+ message_format(MSG_SHOOT_HIT, 0,
665+ LS(__T("The %s %s %s."), /* Translation TBC */
666+ spaceme(langbuf,__T("%sが%3$sに%2$s。"))), /* 矢がモンスターに当たった */
667+ o_name, hit_verb, m_name);
662668
663669 /* Hack -- Track this monster race */
664670 if (m_ptr->ml) monster_race_track(m_ptr->r_idx);
@@ -679,8 +685,9 @@
679685 /* Complex message */
680686 if (p_ptr->wizard)
681687 {
682- msg_format(__T("You do %d (out of %d) damage."),
683- tdam, m_ptr->hp);
688+ msg_format(LS( __T("You do %d (out of %d) damage."), /* Translation TBC */
689+ spaceme(langbuf,__T("%2$dから%1$dダメージを与えた。"))),
690+ tdam, m_ptr->hp);
684691 }
685692 /* Hit the monster, check for death */
686693 if (mon_take_hit(cave_m_idx[y][x], tdam, &fear, note_dies))
@@ -702,7 +709,8 @@
702709
703710 /* Message */
704711 message_format(MSG_FLEE, m_ptr->r_idx,
705- __T("%^s flees in terror!"), m_name);
712+ LS( __T("%^s flees in terror!"),
713+ spaceme(langbuf,__T("%^sが怖くなって逃げ出した。"))), m_name); /* Translation TBC */
706714 }
707715 }
708716 }
@@ -794,6 +802,7 @@
794802 s16b ty, tx;
795803 int chance, tdam, tdis;
796804 int weight;
805+ _TCHAR langbuf[200];
797806
798807 object_type *o_ptr;
799808
@@ -923,7 +932,6 @@
923932 /* Pause anyway, for consistancy */
924933 Term_xtra(TERM_XTRA_DELAY, msec);
925934 }
926-
927935 /* Handle monster */
928936 if (cave_m_idx[y][x] > 0)
929937 {
@@ -940,11 +948,13 @@
940948 /* Did we hit it (penalize range) */
941949 if (test_hit(chance2, r_ptr->ac, m_ptr->ml))
942950 {
943- const _TCHAR *hit_verb = __T("hits");
951+ const _TCHAR *hit_verb = LS(__T("hits"),
952+ spaceme(langbuf, __T("当たった。")));
944953 bool fear = FALSE;
945954
946955 /* Assume a default death */
947- const _TCHAR *note_dies = __T(" dies.");
956+ const _TCHAR *note_dies = LS(__T(" dies."), /* Translation TBC */
957+ spaceme(langbuf,__T("が死んだ")));
948958
949959 /* Some monsters get "destroyed" */
950960 if ((r_ptr->flags[2] & (RF2_DEMON)) ||
@@ -953,7 +963,8 @@
953963 (_tcschr(__T("Evg"), r_ptr->d_char)))
954964 {
955965 /* Special note at death */
956- note_dies = __T(" is destroyed.");
966+ note_dies = LS(__T(" is destroyed."), /* Translation TBC */
967+ spaceme(langbuf,__T("が破壊された。")));
957968 }
958969 /* Apply special damage - brought forward to fill in hit_verb XXX XXX XXX */
959970 tdam *= get_brand_mult(i_ptr, m_ptr,
@@ -963,7 +974,8 @@
963974 if (!visible)
964975 {
965976 /* Invisible monster */
966- msg_format(__T("The %s finds a mark."), o_name);
977+ msg_format(LS( __T("The %s finds a mark."), /* Translation TBC */
978+ spaceme(langbuf,__T("%s が何かに当たった。"))), o_name);
967979 }
968980 else /* Handle visible monster */
969981 {
@@ -972,8 +984,11 @@
972984 /* Get "the monster" or "it" */
973985 monster_desc(m_name, _countof(m_name), m_ptr, 0);
974986
975- /* Message */
976- msg_format(__T("The %s %s %s."), o_name, hit_verb, m_name);
987+ /* Message */ /* The arrow hits the monster */
988+ message_format(MSG_SHOOT_HIT, 0,
989+ LS(__T("The %s %s %s."), /* Translation TBC */
990+ spaceme(langbuf,__T("%sが%3$sに%2$s。"))), /* 矢がモンスターに当たった */
991+ o_name, hit_verb, m_name);
977992
978993 /* Hack -- Track this monster race */
979994 if (m_ptr->ml) monster_race_track(m_ptr->r_idx);
@@ -990,8 +1005,9 @@
9901005 /* Complex message */
9911006 if (p_ptr->wizard)
9921007 {
993- msg_format(__T("You do %d (out of %d) damage."),
994- tdam, m_ptr->hp);
1008+ msg_format(LS( __T("You do %d (out of %d) damage."), /* Translation TBC */
1009+ spaceme(langbuf,__T("%2$dから%1$dダメージを与えた。"))),
1010+ tdam, m_ptr->hp);
9951011 }
9961012 /* Hit the monster, check for death */
9971013 if (mon_take_hit(cave_m_idx[y][x], tdam, &fear, note_dies))
@@ -1013,7 +1029,8 @@
10131029
10141030 /* Message */
10151031 message_format(MSG_FLEE, m_ptr->r_idx,
1016- __T("%^s flees in terror!"), m_name);
1032+ LS( __T("%^s flees in terror!"),
1033+ spaceme(langbuf,__T("%^sが怖くなって逃げ出した。"))), m_name); /* Translation TBC */
10171034 }
10181035 }
10191036 }
Show on old repository browser