@@ -72,7 +72,7 @@ module.exports = class Game {
7272 }
7373
7474 say ( name , l ) {
75- if ( this . _view ) this . _view . say ( name , l ) ;
75+ if ( this . _view ) this . _view . say ( name , l ) ;
7676 }
7777
7878 stop ( callback = ( ) => { } ) {
@@ -298,12 +298,12 @@ module.exports = class Game {
298298
299299 if ( this . _diyizimo ) {
300300 if ( ! dapai . match ( / ^ z [ 1 2 3 4 ] / ) ) this . _fengpai = false ;
301- if ( this . _dapai && this . _dapai . substr ( 0 , 2 ) != dapai . substr ( 0 , 2 ) )
301+ if ( this . _dapai && this . _dapai . slice ( 0 , 2 ) != dapai . slice ( 0 , 2 ) )
302302 this . _fengpai = false ;
303303 }
304304 else this . _fengpai = false ;
305305
306- if ( dapai . substr ( - 1 ) == '*' ) {
306+ if ( dapai . slice ( - 1 ) == '*' ) {
307307 this . _lizhi [ model . lunban ] = this . _diyizimo ? 2 : 1 ;
308308 this . _yifa [ model . lunban ] = this . _rule [ '一発あり' ] ;
309309 }
@@ -448,8 +448,8 @@ module.exports = class Game {
448448 let menfeng = this . _hule . length ? this . _hule . shift ( ) : model . lunban ;
449449 let rongpai = menfeng == model . lunban ? null
450450 : ( this . _hule_option == 'qianggang'
451- ? this . _gang [ 0 ] + this . _gang . substr ( - 1 )
452- : this . _dapai . substr ( 0 , 2 )
451+ ? this . _gang [ 0 ] + this . _gang . slice ( - 1 )
452+ : this . _dapai . slice ( 0 , 2 )
453453 ) + '_+=-' [ ( 4 + model . lunban - menfeng ) % 4 ] ;
454454 let shoupai = model . shoupai [ menfeng ] . clone ( ) ;
455455 let fubaopai = shoupai . lizhi ? model . shan . fubaopai : null ;
@@ -728,7 +728,7 @@ module.exports = class Game {
728728 else if ( reply . dapai ) {
729729 let dapai = reply . dapai . replace ( / \* $ / , '' ) ;
730730 if ( this . get_dapai ( ) . find ( p => p == dapai ) ) {
731- if ( reply . dapai . substr ( - 1 ) == '*' && this . allow_lizhi ( dapai ) ) {
731+ if ( reply . dapai . slice ( - 1 ) == '*' && this . allow_lizhi ( dapai ) ) {
732732 this . say ( 'lizhi' , model . lunban ) ;
733733 return this . delay ( ( ) => this . dapai ( reply . dapai ) ) ;
734734 }
@@ -770,7 +770,7 @@ module.exports = class Game {
770770 return this . delay ( ( ) => this . hule ( ) ) ;
771771 }
772772
773- if ( this . _dapai . substr ( - 1 ) == '*' ) {
773+ if ( this . _dapai . slice ( - 1 ) == '*' ) {
774774 model . defen [ model . player_id [ model . lunban ] ] -= 1000 ;
775775 model . lizhibang ++ ;
776776
@@ -872,7 +872,7 @@ module.exports = class Game {
872872 this . _hule . push ( l ) ;
873873 }
874874 else {
875- let p = this . _gang [ 0 ] + this . _gang . substr ( - 1 ) ;
875+ let p = this . _gang [ 0 ] + this . _gang . slice ( - 1 ) ;
876876 let shoupai = model . shoupai [ l ] . clone ( ) . zimo ( p ) ;
877877 if ( Majiang . Util . xiangting ( shoupai ) == - 1 )
878878 this . _neng_rong [ l ] = false ;
@@ -969,7 +969,7 @@ module.exports = class Game {
969969 }
970970 else {
971971 let p = ( this . _status == 'gang'
972- ? this . _gang [ 0 ] + this . _gang . substr ( - 1 )
972+ ? this . _gang [ 0 ] + this . _gang . slice ( - 1 )
973973 : this . _dapai
974974 ) + '_+=-' [ ( 4 + model . lunban - l ) % 4 ] ;
975975 let hupai = model . shoupai [ l ] . lizhi
0 commit comments