• R/O
  • SSH
  • HTTPS

jband: Commit


Commit MetaInfo

Revision125 (tree)
Time2009-06-26 04:18:27
Authorpaulblay

Log Message

Some more translation work in attack.cpp.

Change Summary

Incremental Difference

--- trunk/JBand/src/attack.cpp (revision 124)
+++ trunk/JBand/src/attack.cpp (revision 125)
@@ -290,6 +290,7 @@
290290 void py_attack(int y, int x)
291291 {
292292 int num = 0, bonus, chance;
293+ _TCHAR langbuf[200];
293294
294295 monster_type *m_ptr;
295296 monster_race *r_ptr;
@@ -339,7 +340,8 @@
339340 if (test_hit(chance, r_ptr->ac, m_ptr->ml))
340341 {
341342 /* Default to punching for one damage */
342- const _TCHAR *hit_verb = __T("You punch %s.");
343+ const _TCHAR *hit_verb = LS(__T("You punch %s."),
344+ spaceme(langbuf,__T("%sを殴った。"))); /* Translation TBC */
343345 int k = 1;
344346
345347 /* Handle normal weapon */
@@ -348,7 +350,8 @@
348350 int weapon_brand_mult, ring_brand_mult[2];
349351 int use_mult = 1;
350352
351- hit_verb = __T("You hit %s.");
353+ hit_verb = LS(__T("You hit %s."),
354+ spaceme(langbuf,__T("%sに当たった。"))); /* Translation TBC */
352355
353356 /* Hack-- put rings first, because they can
354357 * only be brands right now */
@@ -400,7 +403,9 @@
400403
401404 /* Complex message */
402405 if (p_ptr->wizard)
403- msg_format(__T("You do %d (out of %d) damage."), k, m_ptr->hp);
406+ msg_format(LS( __T("You do %d (out of %d) damage."), /* Translation TBC */
407+ spaceme(langbuf,__T("%2$dから%1$dダメージを与えた。"))),
408+ k, m_ptr->hp);
404409
405410 /* Damage, check for fear and death */
406411 if (mon_take_hit(cave_m_idx[y][x], k, &fear, NULL)) break;
@@ -413,7 +418,7 @@
413418 p_ptr->confusing = FALSE;
414419
415420 /* Message */
416- msg_print(LS(__T("Your hands stop glowing."),
421+ msg_print( LS(__T("Your hands stop glowing."),
417422 spaceme(langbuf, __T("手の輝きがなくなった。")))); /* Translation TBC */
418423
419424 /* Confuse the monster */
@@ -423,36 +428,38 @@
423428 {
424429 l_ptr->flags[2] |= (RF2_NO_CONF);
425430 }
426-
427- msg_format(__T("%^s is unaffected."), m_name);
431+ msg_format( LS(__T("%^s is unaffected."), /* Translation TBC */
432+ spaceme(langbuf,__T("%^sには効果がなかった。"))), m_name);
428433 }
429434 else if (randint0(100) < r_ptr->level)
430435 {
431- msg_format(__T("%^s is unaffected."), m_name);
436+ msg_format( LS(__T("%^s is unaffected."), /* Translation TBC */
437+ spaceme(langbuf,__T("%^sには効果がなかった。"))), m_name);
432438 }
433439 else
434440 {
435- msg_format(__T("%^s appears confused."), m_name);
441+ msg_format( LS(__T("%^s appears confused."), /* Translation TBC */
442+ spaceme(langbuf,__T("%^sが混乱しているようだ。"))), m_name);
436443 m_ptr->confused += 10 + (byte) randint0(p_ptr->lev) / 5;
437444 }
438445 }
439446 }
440-
441- /* Player misses */
442- else
447+ else /* Player misses */
443448 {
444449 /* Message */
445- message_format(MSG_MISS, m_ptr->r_idx, __T("You miss %s."), m_name);
450+ message_format(MSG_MISS, m_ptr->r_idx,
451+ LS(__T("You miss %s."),
452+ spaceme(langbuf,__T("%sに当たらなかった。"))), m_name); /* Translation TBC */
446453 }
447454 }
448-
449455 /* Hack -- delay fear messages */
450456 if (fear && m_ptr->ml)
451457 {
452458 /* Message */
453- message_format(MSG_FLEE, m_ptr->r_idx, __T("%^s flees in terror!"), m_name);
459+ message_format(MSG_FLEE, m_ptr->r_idx,
460+ LS(__T("%^s flees in terror!"),
461+ spaceme(langbuf,__T("%^sが怖くなって逃げ出した。"))), m_name); /* Translation TBC */
454462 }
455-
456463 /* Mega-Hack -- apply earthquake brand */
457464 if (do_quake) earthquake(p_ptr->py, p_ptr->px, 10);
458465 }
@@ -539,7 +546,6 @@
539546 return;
540547 }
541548 }
542-
543549 /* Sound */
544550 sound(MSG_SHOOT);
545551
@@ -597,14 +603,11 @@
597603 Term_fresh();
598604 if (p_ptr->redraw) redraw_stuff();
599605 }
600-
601- /* Delay anyway for consistency */
602- else
606+ else /* Delay anyway for consistency */
603607 {
604608 /* Pause anyway, for consistancy */
605609 Term_xtra(TERM_XTRA_DELAY, msec);
606610 }
607-
608611 /* Handle monster */
609612 if (cave_m_idx[y][x] > 0)
610613 {
@@ -641,7 +644,6 @@
641644 /* Special note at death */
642645 note_dies = __T(" is destroyed.");
643646 }
644-
645647 /* Handle unseen monster */
646648 if (!visible)
647649 {
@@ -648,9 +650,7 @@
648650 /* Invisible monster */
649651 message_format(MSG_SHOOT_HIT, 0, __T("The %s finds a mark."), o_name);
650652 }
651-
652- /* Handle visible monster */
653- else
653+ else /* Handle visible monster */
654654 {
655655 _TCHAR m_name[80];
656656
@@ -666,7 +666,6 @@
666666 /* Hack -- Track this monster */
667667 if (m_ptr->ml) health_track(cave_m_idx[y][x]);
668668 }
669-
670669 /* Apply damage: multiplier, slays, criticals, bonuses */
671670 tdam = damroll(o_ptr->dd, o_ptr->ds);
672671 tdam += o_ptr->to_d + j_ptr->to_d;
@@ -683,15 +682,12 @@
683682 msg_format(__T("You do %d (out of %d) damage."),
684683 tdam, m_ptr->hp);
685684 }
686-
687685 /* Hit the monster, check for death */
688686 if (mon_take_hit(cave_m_idx[y][x], tdam, &fear, note_dies))
689687 {
690688 /* Dead monster */
691689 }
692-
693- /* No death */
694- else
690+ else /* No death */
695691 {
696692 /* Message */
697693 message_pain(cave_m_idx[y][x], tdam);
@@ -710,12 +706,10 @@
710706 }
711707 }
712708 }
713-
714709 /* Stop looking */
715710 break;
716711 }
717712 }
718-
719713 /* Get local object */
720714 i_ptr = &object_type_body;
721715
@@ -732,14 +726,11 @@
732726 inven_item_describe(item);
733727 inven_item_optimize(item);
734728 }
735-
736- /* Reduce and describe floor item */
737- else
729+ else /* Reduce and describe floor item */
738730 {
739731 floor_item_increase(0 - item, -1);
740732 floor_item_optimize(0 - item);
741733 }
742-
743734 /* Chance of breakage (during attacks) */
744735 j = (hit_body ? breakage_chance(i_ptr) : 0);
745736
@@ -847,14 +838,11 @@
847838 inven_item_describe(item);
848839 inven_item_optimize(item);
849840 }
850-
851- /* Reduce and describe floor item */
852- else
841+ else /* Reduce and describe floor item */
853842 {
854843 floor_item_increase(0 - item, -1);
855844 floor_item_optimize(0 - item);
856845 }
857-
858846 /* Description */
859847 object_desc(o_name, _countof(o_name), i_ptr, FALSE, ODESC_FULL);
860848
@@ -930,9 +918,7 @@
930918 Term_fresh();
931919 if (p_ptr->redraw) redraw_stuff();
932920 }
933-
934- /* Delay anyway for consistency */
935- else
921+ else /* Delay anyway for consistency */
936922 {
937923 /* Pause anyway, for consistancy */
938924 Term_xtra(TERM_XTRA_DELAY, msec);
Show on old repository browser