@@ -7,6 +7,7 @@ var ChronicleScreen = (function() {
77
88 var MAX_POST_LENGTH = 280 ;
99 var BLESS_ENERGY = 100 ; // 1% = 100 basis points
10+ var BLESS_MEMO_PREFIX = 'viz://vm/bless/' ;
1011 var currentTab = 'all' ; // all, guild, friends, world
1112 var REQUIRED_TAG = '#viz_magic' ;
1213
@@ -314,8 +315,8 @@ var ChronicleScreen = (function() {
314315 '<p class="chronicle-text">' + Helpers . escapeHtml ( entry . text ) + '</p>' +
315316 '<div class="chronicle-actions">' +
316317 '<button class="bless-button" data-account="' + ( entry . account || '' ) + '" ' +
317- 'aria-label="' + t ( 'chronicle_bless' ) + ' ' + Helpers . escapeHtml ( charName ) + '">' +
318- '\u2728 ' + t ( 'chronicle_bless' ) +
318+ 'aria-label="' + Helpers . escapeHtml ( t ( 'chronicle_bless_cost' , { cost : Helpers . manaCost ( BLESS_ENERGY ) , name : charName } ) ) + '">' +
319+ '✨ ' + t ( 'chronicle_bless' ) + ' · ' + Helpers . manaCost ( BLESS_ENERGY ) +
319320 '</button>' +
320321 '</div>' +
321322 '</article>' ;
@@ -331,7 +332,7 @@ var ChronicleScreen = (function() {
331332 SoundManager . play ( 'bless_send' ) ;
332333 SoundManager . vibrate ( 'light' ) ;
333334
334- var memo = 'viz://vm/bless/' + account ;
335+ var memo = BLESS_MEMO_PREFIX + account ;
335336 VizBroadcast . award ( account , BLESS_ENERGY , 0 , memo , [ ] , function ( err ) {
336337 if ( err ) {
337338 Toast . error ( Helpers . t ( 'error_low_mana' ) ) ;
@@ -387,12 +388,18 @@ var ChronicleScreen = (function() {
387388 case 'rest_complete' :
388389 return t ( 'chronicle_narrative_rest' , { name : name } ) ;
389390 case 'blessing_sent' :
391+ if ( ! _isBlessAction ( action ) ) return null ;
390392 return t ( 'chronicle_narrative_bless' , { name : name , target : action . receiver || '' } ) ;
391393 default :
392394 return null ;
393395 }
394396 }
395397
398+ function _isBlessAction ( action ) {
399+ if ( ! action ) return false ;
400+ return action . type === 'blessing_sent' && action . memo && String ( action . memo ) . indexOf ( BLESS_MEMO_PREFIX ) === 0 ;
401+ }
402+
396403 function _duelToNarrative ( duel , state ) {
397404 var t = Helpers . t ;
398405 var charA = state . characters [ duel . challenger ] || { } ;
0 commit comments