@@ -514,19 +514,19 @@ class BattleUnit
514514 } ,
515515 'inv' ( instruction ) {
516516 if ( instruction === undefined ) {
517- console . log ( "'" + this . id + " inv': No instruction provided" ) ;
517+ console . log ( `' ${ this . id } inv' - no instruction provided` ) ;
518518 return ;
519519 }
520520 let itemCount , itemID ;
521521 switch ( instruction ) {
522522 case 'add' : {
523523 if ( arguments . length < 2 ) {
524- console . log ( "'" + this . id + " inv add': Item ID required" ) ;
524+ console . log ( `' ${ this . id } inv add' - item ID required` ) ;
525525 return ;
526526 }
527527 itemID = arguments [ 1 ] ;
528528 if ( ! ( itemID in Items ) )
529- return console . log ( " no such item ID '" + itemID + "'" ) ;
529+ return console . log ( ` no such item ID '${ itemID } '` ) ;
530530 let defaultUses = 'uses' in Items [ itemID ] ? Items [ itemID ] . uses : 1 ;
531531 itemCount = arguments [ 2 ] > 0 ? arguments [ 2 ] : defaultUses ;
532532 let usables = from ( this . items )
@@ -542,33 +542,32 @@ class BattleUnit
542542 this . items . push ( usable ) ;
543543 addCount = itemCount ;
544544 }
545- console . log ( addCount + "x " + Items [ itemID ] . name + " added to " + this . name + " 's inventory" ) ;
545+ console . log ( ` ${ addCount } x ${ Items [ itemID ] . name } added to ${ this . name } 's inventory` ) ;
546546 break ;
547547 }
548548 case 'munch' : {
549549 new Scene ( ) . playSound ( 'Munch.wav' ) . run ( ) ;
550550 this . items . length = 0 ;
551- console . log ( " maggie ate " + this . name + " 's entire inventory" ) ;
551+ console . log ( ` maggie ate ${ this . name } 's entire inventory` ) ;
552552 break ;
553553 }
554554 case 'rm' : {
555555 if ( arguments . length < 2 )
556- return console . log ( "'" + this . id + " inv add': Item ID required" ) ;
556+ return console . log ( `' ${ this . id } inv add' - item ID required` ) ;
557557 itemID = arguments [ 1 ] ;
558558 itemCount = 0 ;
559559 from ( this . items )
560560 . where ( it => it . itemID === itemID )
561561 . besides ( it => itemCount += it . usesLeft )
562562 . remove ( ) ;
563563 if ( itemCount > 0 )
564- console . log ( itemCount + "x " + Items [ itemID ] . name
565- + " deleted from " + this . name + "'s inventory" ) ;
564+ console . log ( `${ itemCount } x ${ Items [ itemID ] . name } removed from ${ this . name } 's inventory` ) ;
566565 else
567- console . log ( "No " + Items [ itemID ] . name + " in " + this . name + " 's inventory" ) ;
566+ console . log ( `no ${ Items [ itemID ] . name } in ${ this . name } 's inventory` ) ;
568567 break ;
569568 }
570569 default : {
571- return console . log ( "'" + this . id + " inv': Unknown instruction '" + instruction + "'" ) ;
570+ return console . log ( `' ${ this . id } inv' - unknown instruction '${ instruction } '` ) ;
572571 }
573572 }
574573 } ,
0 commit comments