@@ -287,10 +287,26 @@ var DuelScreen = (function() {
287287 }
288288
289289 function _onIntentSelect ( ) {
290- if ( duelState . selectedIntent ) return ;
290+ if ( duelState . selectedIntent ) {
291+ console . log ( 'DuelScreen: intent select ignored because selectedIntent already set' , {
292+ selectedIntent : duelState . selectedIntent ,
293+ combatRef : duelState . combatRef ,
294+ opponent : duelState . opponent ,
295+ pendingAction : duelState . pendingAction ,
296+ currentRound : duelState . currentRound
297+ } ) ;
298+ return ;
299+ }
291300
292301 var intent = this . getAttribute ( 'data-intent' ) ;
293302 duelState . selectedIntent = intent ;
303+ console . log ( 'DuelScreen: intent selected' , {
304+ intent : intent ,
305+ combatRef : duelState . combatRef ,
306+ opponent : duelState . opponent ,
307+ pendingAction : duelState . pendingAction ,
308+ currentRound : duelState . currentRound
309+ } ) ;
294310
295311 var cards = document . querySelectorAll ( '.spell-card' ) ;
296312 for ( var i = 0 ; i < cards . length ; i ++ ) {
@@ -324,6 +340,14 @@ var DuelScreen = (function() {
324340 }
325341
326342 function _commitStrategy ( intent ) {
343+ console . log ( 'DuelScreen: _commitStrategy start' , {
344+ intent : intent ,
345+ combatRef : duelState . combatRef ,
346+ opponent : duelState . opponent ,
347+ pendingAction : duelState . pendingAction ,
348+ currentRound : duelState . currentRound
349+ } ) ;
350+
327351 var salt = DuelSystem . generateSalt ( ) ;
328352 var strategy = {
329353 intent : intent ,
@@ -357,6 +381,11 @@ var DuelScreen = (function() {
357381
358382 // Accept flow: broadcast accept with strategy hash
359383 if ( duelState . pendingAction === 'accept' && duelState . combatRef ) {
384+ console . log ( 'DuelScreen: broadcasting accept' , {
385+ combatRef : duelState . combatRef ,
386+ round : duelState . currentRound ,
387+ hash : hash
388+ } ) ;
360389 DuelProtocol . acceptChallenge (
361390 duelState . combatRef ,
362391 hash ,
@@ -375,6 +404,11 @@ var DuelScreen = (function() {
375404 ) ;
376405 } else if ( duelState . combatRef && duelState . currentRound > 1 ) {
377406 duelState . pendingAction = 'commit' ;
407+ console . log ( 'DuelScreen: broadcasting commit' , {
408+ combatRef : duelState . combatRef ,
409+ round : duelState . currentRound ,
410+ hash : hash
411+ } ) ;
378412 DuelProtocol . commitStrategy (
379413 duelState . combatRef ,
380414 duelState . currentRound ,
@@ -394,6 +428,12 @@ var DuelScreen = (function() {
394428 duelState . pendingAction = 'challenge' ;
395429 var currentBlock = StateEngine . getState ( ) . headBlock || 0 ;
396430 var deadline = currentBlock + VizMagicConfig . BLOCK . DUEL_ACCEPT_WINDOW ;
431+ console . log ( 'DuelScreen: broadcasting challenge' , {
432+ opponent : duelState . opponent ,
433+ currentBlock : currentBlock ,
434+ deadline : deadline ,
435+ hash : hash
436+ } ) ;
397437 DuelProtocol . createChallenge (
398438 duelState . opponent ,
399439 'best_of_3' , 3 , 100 , hash , deadline ,
@@ -410,6 +450,12 @@ var DuelScreen = (function() {
410450 ) ;
411451 } else if ( duelState . combatRef && _canRevealCurrentRound ( ) ) {
412452 duelState . pendingAction = 'reveal' ;
453+ console . log ( 'DuelScreen: broadcasting reveal' , {
454+ combatRef : duelState . combatRef ,
455+ round : duelState . currentRound ,
456+ hash : hash ,
457+ intent : intent
458+ } ) ;
413459 DuelProtocol . revealStrategy (
414460 duelState . combatRef ,
415461 duelState . currentRound ,
0 commit comments