(function($,undefined){$.jweGame={_oneKill:0,_playerMoveCount:0,_sumScore:0.00,_scoreArr:new Array(),_gameTime:0,_bestUType:null,_girlSpeechArr:null,_lastKilledUNum:-1,_lastKilledUGoodNum:-1,_itv_run:null,gameStart:function(){try{$.jwe.clearContainer();$.jwe.initContainer();$.jwe.newStuff();$.jweCtrl.BindEvents();$.jwe.LoadGamingGirls();$.jwe.resizeContainer();$.jweAnimate.showGameStartInfo(_gameStoryInfo,_fullGameTime+"秒<br>开始")}catch(ex){alert("jweGame - game start err: "+ex)}},gameOver:function(){$.jweAnimate.showGameOverInfo("时间到",_bestScoreTitle);$("#panelTb").remove();$("#scorePanel").remove();$("#timeBar").remove()},runGameRules:function(delay){try{if($.jweCtrl._busyLock)return;var os=$.jweArithmetic.CheckAllLinkState();var num=(os==null?0:os.length);var goodNum=0;if(num>0){try{var idArr=$.jwe.KillUnits(os)}catch(exx){alert(1)}try{var dropingColArr=$.jwe.findBelongColumn(idArr)}catch(exx){alert(2)}try{$.jwe.DropDownUnits(dropingColArr)}catch(exx){alert(3)}try{goodNum=$.jweArithmetic.checkGoodObjNum(os)}catch(exx){alert(4)}try{if(goodNum>0){$.jweAnim2.StarAnim(idArr)}}catch(exx){debug(5+""+exx.message)}try{$.jweGame.ComputeARoundScore(goodNum)}catch(exx){alert(6)}}try{if(num==0&&goodNum==0&&this._lastKilledUNum==0&&this._lastKilledUGoodNum==0){$.jweGame.scoreRanking()}}catch(exx){alert(7)}if(num>0||goodNum>0){var delay2=$.jweAnimate._unitDownTime+$.jweAnimate._afterMoveDelay;setTimeout(function(){$.jweGame.runGameRules()},delay2)}else if(this._lastKilledUNum>0||this._lastKilledUGoodNum>0){setTimeout(function(){$.jweGame.runGameRules()},0)}this._lastKilledUNum=num;this._lastKilledUGoodNum=goodNum}catch(ex){alert("jweGame - Rules err:\n"+ex.message)}},scoreRanking:function(delay){if(delay==null)delay=0;setTimeout(function(){$.jwe.SortScorePanle();$.jweAnimate.moveAllGamingGirls()},delay)},addScore:function(n,dv){var ret=true;var v0=this._scoreArr[n];var v1=v0+dv;if(v1>=0){this._scoreArr[n]=v1}else{ret=false}return ret},AddSumScore:function(dv){var v=parseFloat(this._sumScore)+parseFloat(dv);var v2=new Number(v);this._sumScore=v2.toFixed(2);if(this._sumScore<0){this._sumScore=0}$("#sumScore").text(this._sumScore);$("#finSumScore").text(this._sumScore)},StartCountTime:function(interval){var time=this._gameTime*1000;$("#gameTime").text("").animate({height:0},time,function(){$.jweGame._gameTime=0;$.jweGame.gameOver()})},roundRun:function(){this._oneKill=0;this._playerMoveCount++},ComputeARoundScore:function(num){if(num<=0||isNaN(num))return 0;var score=num+$.jweArithmetic.computeAdditionalScore(this._oneKill,num);this._oneKill+=num;this.AddSumScore(score);return score}}}(jQuery));