home *** CD-ROM | disk | FTP | other *** search
Text File | 2006-06-13 | 31.4 KB | 1,170 lines |
- class com.KidFighting.objects.CCharacter extends com.KidFighting.objects.CObject
- {
- var m_skillList;
- var orgY;
- var orgScale;
- var updaterObj;
- var _twnF;
- var _twnX;
- var _twnY;
- var _performedSkill;
- var crtHP;
- var orgX;
- var side;
- var ani;
- var isInvincible;
- var maxHP;
- var opponent;
- var updater;
- var jump;
- var speed;
- var onEnterFrame;
- var invTimer;
- var dispatchEvent;
- var lbNormal = 1;
- var lbR = 2;
- var lbL = 3;
- var lbDn = 4;
- var lbDnGetup = 5;
- var lbJp = 6;
- var lbJpR = 7;
- var lbJpL = 8;
- var lbK1 = 9;
- var lbK2 = 10;
- var lbK3 = 11;
- var lbDnK1 = 12;
- var lbDnK2 = 13;
- var lbDnK3 = 14;
- var lbJpK1 = 15;
- var lbJpK2 = 16;
- var lbJpK3 = 17;
- var lbJpRLK1 = 18;
- var lbJpRLK2 = 19;
- var lbJpRLK3 = 20;
- var lbMidK1 = 21;
- var lbMidK2 = 22;
- var lbMidK3 = 23;
- var lbP1 = 24;
- var lbP2 = 25;
- var lbP3 = 26;
- var lbDnP1 = 27;
- var lbDnP2 = 28;
- var lbDnP3 = 29;
- var lbJpP1 = 30;
- var lbJpP2 = 31;
- var lbJpP3 = 32;
- var lbJpRLP1 = 33;
- var lbJpRLP2 = 34;
- var lbJpRLP3 = 35;
- var lbMidP1 = 36;
- var lbMidP2 = 37;
- var lbMidP3 = 38;
- var lbCatch = 39;
- var lbCought = 40;
- var lbThrown = 41;
- var lbH1 = 42;
- var lbH2 = 43;
- var lbH3 = 44;
- var lbDnH1 = 45;
- var lbDnH2 = 46;
- var lbDnH3 = 47;
- var lbJpH1 = 48;
- var lbJpH2 = 49;
- var lbJpH3 = 50;
- var lbJpRLH1 = 51;
- var lbJpRLH2 = 52;
- var lbJpRLH3 = 53;
- var lbMidH1 = 54;
- var lbMidH2 = 55;
- var lbMidH3 = 56;
- var lbHGetup = 57;
- var lbHDie = 58;
- var lbUpB = 59;
- var lbMidB = 60;
- var lbDnB = 61;
- var lbWin = 62;
- var lbLose = 63;
- var lbS1 = 64;
- var lbS2 = 65;
- var lbS3 = 66;
- var lbS4 = 67;
- var lbS5 = 68;
- var lbIntro = 71;
- var direction = "";
- var shadow = null;
- var sex = "male";
- var status = "normal";
- static var _evt = mx.events.EventDispatcher;
- static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(com.KidFighting.objects.CCharacter.prototype);
- function CCharacter()
- {
- super();
- mx.events.EventDispatcher.initialize(this);
- this.m_skillList = {};
- this.orgY = 325;
- this.orgScale = 100;
- this.updaterObj = {};
- this._twnF = new ds.transitions.Tween(null,"_currentframe",null,1,1,1);
- this._twnX = new ds.transitions.Tween(null,"_x",null,1,1,1);
- this._twnY = new ds.transitions.Tween(null,"_y",null,1,1,1);
- this.updaterObj.updater = this;
- _global.MovieClip.addListener(this.updaterObj);
- }
- function performingSkill()
- {
- return this._performedSkill;
- }
- function get HP()
- {
- return this.crtHP;
- }
- function get skillList()
- {
- return this.m_skillList;
- }
- function setup(strSide)
- {
- if(strSide == "left" || strSide == "right")
- {
- if(strSide == "left")
- {
- this.orgX = 160;
- this.side = 1;
- }
- else
- {
- this.orgX = 470;
- this.side = -1;
- }
- if(this.shadow == undefined)
- {
- this.shadow = new com.KidFighting.objects.CShadow();
- this.shadow.follow(this.ani);
- }
- this._twnX.obj = this.ani;
- this._twnY.obj = this.ani;
- this.status = "normal";
- this.direction = "";
- this.isInvincible = false;
- for(var _loc2_ in this.m_skillList)
- {
- this.m_skillList[_loc2_].performing = false;
- }
- this._performedSkill = null;
- this.crtHP = this.maxHP;
- this.ani._x = this.orgX;
- this.ani._y = this.orgY;
- this.orgScale = 100;
- this.ani._xscale = this.orgScale;
- this.updateSide();
- return true;
- }
- return false;
- }
- function freeze()
- {
- this.updaterObj.onEnterFrame = undefined;
- if(this.status == "left" || this.status == "right")
- {
- this.movNormal();
- }
- }
- function onceAni(lb, cb)
- {
- this._twnF.stop();
- delete this._twnF.onMotionFinished;
- this.ani.gotoAndStop(lb);
- var _loc2_ = this.getInstance();
- this._twnF.obj = _loc2_;
- this._twnF.finish = this._twnF.duration = _loc2_._totalframes;
- if(cb != undefined)
- {
- this._twnF.onMotionFinished = cb;
- }
- this._twnF.start();
- }
- function loopAni(lb)
- {
- delete this._twnF.onMotionFinished;
- this._twnF.stop();
- this.ani.gotoAndStop(lb);
- this.getInstance().play();
- }
- function correctPosition()
- {
- if(Math.abs(this.ani._x - this.opponent.ani._x) < 30)
- {
- this.ani._x -= 30 * this.side;
- }
- }
- function correctOffside()
- {
- if(this.ani._x > Stage.width - 50)
- {
- this.ani._x = Stage.width - 50;
- }
- else if(this.ani._x < 50)
- {
- this.ani._x = 50;
- }
- }
- function updateSide(sd)
- {
- if(sd != undefined)
- {
- this.side = sd;
- }
- if(this.orgScale * this.side != this.ani._xscale)
- {
- this.ani._xscale = this.orgScale * this.side;
- }
- }
- function startXTween(func, mov, step, cb)
- {
- this._twnX.stop();
- mov;
- if(this.ani._x + mov > Stage.width - 50)
- {
- mov = Stage.width - 50 - this.ani._x;
- }
- else if(this.ani._x + mov < 50)
- {
- mov = - (this.ani._x - 50);
- }
- var _loc3_ = this;
- var callback = cb;
- this._twnX.func = func;
- this._twnX.begin = this.ani._x;
- this._twnX.finish = this.ani._x + mov;
- this._twnX.duration = step;
- this._twnX.onMotionFinished = function()
- {
- callback();
- };
- this._twnX.start(true);
- }
- function startYTween(func, aim, step, cb)
- {
- this._twnY.stop();
- this._twnY.func = func;
- this._twnY.begin = this.ani._y;
- this._twnY.finish = aim;
- this._twnY.duration = step;
- var _loc2_ = this;
- this._twnY.callback = cb;
- this._twnY.onMotionFinished = function(twn)
- {
- twn.callback();
- };
- this._twnY.start(true);
- }
- function addSkill(skl)
- {
- skl.owner = this;
- this.m_skillList[skl.keys] = skl;
- }
- function getSkill(keyBuffer)
- {
- return this.m_skillList[keyBuffer];
- }
- function getSkillByName(name)
- {
- for(var _loc3_ in this.m_skillList)
- {
- if(this.m_skillList[_loc3_].name == name)
- {
- return this.m_skillList[_loc3_];
- }
- }
- return null;
- }
- function randomGetSkill()
- {
- for(var _loc2_ in this.m_skillList)
- {
- if(random(5) == 2 && this.m_skillList[_loc2_].name != "Throw")
- {
- return this.m_skillList[_loc2_];
- }
- }
- return this.m_skillList[0];
- }
- function movNormal()
- {
- if(this.crtHP > 0)
- {
- this.status = "normal";
- this.direction = "";
- this.updaterObj.onEnterFrame = undefined;
- this.loopAni(this.lbNormal);
- this.updateSide();
- }
- }
- function movRight()
- {
- this.direction = this.status = "right";
- if(this.side == 1)
- {
- this.loopAni(this.lbR);
- }
- else
- {
- this.loopAni(this.lbL);
- }
- this.updaterObj.onEnterFrame = function()
- {
- var _loc2_ = this.updater;
- if(_loc2_.side == -1 || _loc2_.ani._x + _loc2_.speed < _loc2_.opponent.ani._x - 30 || _loc2_.opponent.status == "jump")
- {
- if(_loc2_.ani._x + _loc2_.speed < Stage.width - 50)
- {
- _loc2_.ani._x += _loc2_.speed;
- }
- else
- {
- _loc2_.ani._x = Stage.width - 50;
- }
- }
- _loc2_.updateSide();
- };
- }
- function movLeft()
- {
- this.direction = this.status = "left";
- if(this.side == 1)
- {
- this.loopAni(this.lbL);
- }
- else
- {
- this.loopAni(this.lbR);
- }
- this.updaterObj.onEnterFrame = function()
- {
- var _loc2_ = this.updater;
- if(_loc2_.side == 1 || _loc2_.ani._x - _loc2_.speed > _loc2_.opponent.ani._x + 30 || _loc2_.opponent.status == "jump")
- {
- if(_loc2_.ani._x > 50 + _loc2_.speed)
- {
- _loc2_.ani._x -= _loc2_.speed;
- }
- else
- {
- _loc2_.ani._x = 50;
- }
- }
- _loc2_.updateSide();
- };
- }
- function movDown()
- {
- this.status = "down";
- this.direction = "down";
- this.onceAni(this.lbDn);
- }
- function movStandUp()
- {
- this.status = "standup";
- this.direction = "";
- var o = this;
- this.onceAni(this.lbDnGetup,function()
- {
- o.movNormal();
- }
- );
- this.updateSide();
- }
- function movJump()
- {
- this.status = "jump";
- this.direction = "up";
- this.updateSide();
- this.onceAni(this.lbJp);
- var o = this;
- var jumpStep = Math.round(this.jump / 15);
- this.startYTween(mx.transitions.easing.Strong.easeOut,this.ani._y - this.jump,jumpStep,function()
- {
- o.startYTween(mx.transitions.easing.Regular.easeIn,o.orgY,jumpStep,function()
- {
- o.correctPosition();
- o.correctOffside();
- if(o.status != "hurt")
- {
- o.movNormal();
- }
- }
- );
- }
- );
- }
- function movJumpRight()
- {
- this.status = "jump";
- this.direction = "up";
- if(this.side == 1)
- {
- this.onceAni(this.lbJpR);
- }
- else
- {
- this.onceAni(this.lbJpL);
- }
- this.updateSide();
- var _loc2_ = 80 + this.speed * 3;
- if(this.ani._x + _loc2_ > Stage.width - 51)
- {
- _loc2_ = Stage.width - 51 - this.ani._x;
- }
- var o = this;
- var jumpStep = Math.round(this.jump / 15);
- this.startXTween(null,_loc2_,jumpStep * 2);
- this.startYTween(mx.transitions.easing.Strong.easeOut,this.ani._y - this.jump,jumpStep,function()
- {
- o.startYTween(mx.transitions.easing.Regular.easeIn,o.orgY,jumpStep,function()
- {
- o.correctPosition();
- o.correctOffside();
- if(o.status != "hurt")
- {
- o.movNormal();
- }
- }
- );
- }
- );
- }
- function movJumpLeft()
- {
- this.status = "jump";
- this.direction = "up";
- if(this.side == 1)
- {
- this.onceAni(this.lbJpL);
- }
- else
- {
- this.onceAni(this.lbJpR);
- }
- this.updateSide();
- var _loc2_ = 80 + this.speed * 3;
- if(this.ani._x - _loc2_ < 50)
- {
- _loc2_ = this.ani._x - 50;
- }
- var o = this;
- var jumpStep = Math.round(this.jump / 15);
- this.startXTween(null,- _loc2_,jumpStep * 2);
- this.startYTween(mx.transitions.easing.Strong.easeOut,this.ani._y - this.jump,jumpStep,function()
- {
- o.startYTween(mx.transitions.easing.Regular.easeIn,o.orgY,jumpStep,function()
- {
- o.correctPosition();
- o.correctOffside();
- if(o.status != "hurt")
- {
- o.movNormal();
- }
- }
- );
- }
- );
- }
- function mtPower()
- {
- this.status = "punch";
- this.direction = "";
- this.updaterObj.onEnterFrame = function()
- {
- if(this.updater.hitTest())
- {
- delete this.onEnterFrame;
- }
- };
- this.updateSide();
- var o = this;
- this.onceAni(this.lbP2,function()
- {
- o.movNormal();
- }
- );
- ds.controls.SoundPlayer.playSound("BasicAttack_" + this.sex);
- }
- function mtKick()
- {
- this.status = "kick";
- this.direction = "";
- this.updaterObj.onEnterFrame = function()
- {
- if(this.updater.hitTest())
- {
- delete this.onEnterFrame;
- }
- };
- this.updateSide();
- var o = this;
- this.onceAni(this.lbK2,function()
- {
- o.movNormal();
- }
- );
- ds.controls.SoundPlayer.playSound("BasicAttack_" + this.sex);
- }
- function mtDownPower()
- {
- this.status = "punch";
- this.direction = "down";
- this.updaterObj.onEnterFrame = function()
- {
- if(this.updater.hitTest())
- {
- delete this.onEnterFrame;
- }
- };
- this.updateSide();
- var o = this;
- this.onceAni(this.lbDnP2,function()
- {
- o.updaterObj.onEnterFrame = undefined;
- if(o.direction == "down")
- {
- o.status = "down";
- o.ani.gotoAndStop(o.lbDn);
- o.getInstance().gotoAndStop(o.getInstance()._totalframes);
- }
- else
- {
- o.movStandUp();
- }
- }
- );
- ds.controls.SoundPlayer.playSound("BasicAttack_" + this.sex);
- }
- function mtDownKick()
- {
- this.status = "kick";
- this.direction = "down";
- this.updaterObj.onEnterFrame = function()
- {
- if(this.updater.hitTest())
- {
- delete this.onEnterFrame;
- }
- };
- this.updateSide();
- var o = this;
- this.onceAni(this.lbDnK2,function()
- {
- o.updaterObj.onEnterFrame = undefined;
- if(o.direction == "down")
- {
- o.status = "down";
- o.ani.gotoAndStop(o.lbDn);
- o.getInstance().gotoAndStop(o.getInstance()._totalframes);
- }
- else
- {
- o.movStandUp();
- }
- }
- );
- ds.controls.SoundPlayer.playSound("BasicAttack_" + this.sex);
- }
- function mtBlockUp(hurtEff)
- {
- this.startInvincible(0.1);
- this.status = "block";
- this.updateSide();
- var o = this;
- this.onceAni(this.lbUpB,function()
- {
- o.movNormal();
- }
- );
- if(!this.isOnEdge())
- {
- this.startXTween(null,(- this.side) * (this.opponent.strength * 3),7);
- }
- else if(this.opponent.status != "skill" && this._performedSkill.type != "flyItem")
- {
- this.opponent.startXTween(null,this.side * (this.opponent.strength * 2),5);
- }
- ds.controls.SoundPlayer.playSound("Block");
- if(hurtEff != "nothing")
- {
- com.KidFighting.EffectSys.generate(hurtEff,null,this,this.ani._x + 10 * this.side,this.ani._y - 45);
- }
- }
- function mtBlockDown(hurtEff)
- {
- this.startInvincible(0.1);
- this.status = "block";
- var oldDirection = this.direction;
- this.updateSide();
- var o = this;
- this.onceAni(this.lbDnB,function()
- {
- if(o.direction == oldDirection)
- {
- o.status = "down";
- o.ani.gotoAndStop(o.lbDn);
- o.getInstance().gotoAndStop(o.getInstance()._totalframes);
- }
- else
- {
- o.movStandUp();
- }
- }
- );
- if(!this.isOnEdge())
- {
- this.startXTween(null,(- this.side) * (this.opponent.strength * 3),7);
- }
- else if(this.opponent.status != "skill" && this._performedSkill.type != "flyItem")
- {
- this.opponent.startXTween(null,this.side * (this.opponent.strength * 2),5);
- }
- ds.controls.SoundPlayer.playSound("Block");
- if(hurtEff != "nothing")
- {
- com.KidFighting.EffectSys.generate(hurtEff,null,this,this.ani._x + 10 * this.side,this.ani._y - 15);
- }
- }
- function isOnEdge(off)
- {
- if(off == undefined)
- {
- off = 5;
- }
- if(this.ani._x < 50 + off || this.ani._x > Stage.width - (50 + off))
- {
- return true;
- }
- return false;
- }
- function mtBlastHurt(hurtEff)
- {
- this.updaterObj.onEnterFrame = undefined;
- this.status = "thrown";
- this.side = - this.opponent.side;
- this.updateSide();
- var o = this;
- this.onceAni(this.lbThrown,function()
- {
- o.movNormal();
- o.startInvincible(0.1);
- }
- );
- this.startXTween(null,(- this.side) * (70 + this.opponent.strength * 5),6 + Math.abs(Math.round((o.orgY - o.ani._y) / 9)));
- if(this.direction == "up" || this.status == "jump")
- {
- this._twnY.stop();
- this.startYTween(null,this.ani._y - 10,6,function()
- {
- o.startYTween(null,o.orgY,Math.abs(Math.round((o.orgY - o.ani._y) / 9)),function()
- {
- o.correctPosition();
- o.correctOffside();
- }
- );
- }
- );
- }
- if(this.isOnEdge())
- {
- if(this.opponent.status != "skill" && this._performedSkill.type != "flyItem")
- {
- this.opponent.startXTween(null,this.side * 30,7,null);
- }
- }
- if(hurtEff != "nothing")
- {
- com.KidFighting.EffectSys.generate(hurtEff,null,this,this.ani._x + random(10) * this.side,this.ani._y - 30 - random(30));
- }
- ds.controls.SoundPlayer.playSound("ConnectedHit");
- }
- function startInvincible(time)
- {
- if(this.invTimer == undefined)
- {
- this.invTimer = new ds.controls.Timer();
- }
- this.isInvincible = true;
- this.invTimer.stop();
- this.invTimer.interval = time * 1000;
- var o = this;
- this.invTimer.func = function()
- {
- o.invTimer.stop();
- o.isInvincible = false;
- };
- this.invTimer.start();
- }
- function mtHurtUp(hurtEff)
- {
- if(this.HP > 0)
- {
- var o = this;
- this.status = "hurt";
- if(!this.isOnEdge())
- {
- this.startXTween(null,(- this.side) * (this.opponent.strength * 5),7,null);
- }
- else if(this.opponent.status != "skill" && this._performedSkill.type != "flyItem")
- {
- this.opponent.startXTween(null,this.side * (this.opponent.strength * 3),7,null);
- }
- this.onceAni(this.lbH1,function()
- {
- o.movNormal();
- o.startInvincible(0.1);
- }
- );
- this.side = - this.opponent.side;
- this.updateSide();
- if(hurtEff != "nothing")
- {
- com.KidFighting.EffectSys.generate(hurtEff,null,this,this.ani._x + 10 * this.side,this.ani._y - 45);
- }
- ds.controls.SoundPlayer.playSound("ConnectedHit");
- }
- else
- {
- this.movLose();
- if(hurtEff != "nothing")
- {
- com.KidFighting.EffectSys.generate(hurtEff,null,this,this.ani._x + 10 * this.side,this.ani._y - 45);
- }
- ds.controls.SoundPlayer.playSound("ConnectedHit");
- }
- }
- function mtHurtDown(hurtEff)
- {
- if(this.HP > 0)
- {
- this.status = "hurt";
- var o = this;
- this.side = - this.opponent.side;
- this.updateSide();
- this.onceAni(this.lbH1,function()
- {
- o.movNormal();
- o.startInvincible(0.1);
- }
- );
- if(!this.isOnEdge())
- {
- this.startXTween(null,(- this.side) * (this.opponent.strength * 5),5);
- }
- else if(this.opponent.status != "skill" && this._performedSkill.type != "flyItem")
- {
- this.opponent.startXTween(null,this.side * (this.opponent.strength * 3),5);
- }
- if(hurtEff != "nothing")
- {
- com.KidFighting.EffectSys.generate(hurtEff,null,this,this.ani._x + 10 * this.side,this.ani._y - 15);
- }
- ds.controls.SoundPlayer.playSound("ConnectedHit");
- }
- else
- {
- this.movLose();
- if(hurtEff != "nothing")
- {
- com.KidFighting.EffectSys.generate(hurtEff,null,this,this.ani._x + 10 * this.side,this.ani._y - 15);
- }
- ds.controls.SoundPlayer.playSound("ConnectedHit");
- }
- }
- function mtCought()
- {
- this._twnX.stop();
- this._twnY.stop();
- this.updaterObj.onEnterFrame = undefined;
- this.status = "cought";
- this.direction = "";
- this.ani._x = this.opponent.ani._x - this.side * 5;
- this.ani._y = this.orgY - 15;
- this.side = - this.opponent.side;
- this.onceAni(this.lbCought);
- }
- function mtThrown()
- {
- this.updaterObj.onEnterFrame = undefined;
- this.status = "thrown";
- this.direction = "";
- var o = this;
- this.onceAni(this.lbThrown,function()
- {
- o.movNormal();
- o.startInvincible(0.8);
- }
- );
- this.startXTween(null,this.side * (100 + this.opponent.strength * 8),10);
- this.startYTween(null,this.orgY,4);
- }
- function movLoseTimeOut()
- {
- this.status = "lose";
- this.updateSide();
- this.onceAni(this.lbLose);
- }
- function movLose()
- {
- if(this.status != "thrown")
- {
- this.updateSide();
- this.onceAni(this.lbHDie);
- this.startXTween(null,(- this.side) * (130 + this.opponent.strength * 10),10);
- }
- this.status = "lose";
- }
- function movWin()
- {
- this.status = "win";
- this.onceAni(this.lbWin);
- }
- function movIntro()
- {
- this.status = "intro";
- this.onceAni(this.lbIntro);
- }
- function destroy()
- {
- super.destroy();
- this.shadow.destroy();
- }
- function getInstance()
- {
- return this.ani.getInstanceAtDepth(-16383);
- }
- function onPauseGame()
- {
- if(this._twnF.isPlaying)
- {
- this._twnF.stop();
- }
- if(this._twnX.isPlaying)
- {
- this._twnX.stop();
- }
- if(this._twnY.isPlaying)
- {
- this._twnY.stop();
- }
- this.getInstance().stop();
- _global.MovieClip.removeListener(this.updaterObj);
- }
- function onResumeGame()
- {
- this._twnF.resume();
- this._twnX.resume();
- this._twnY.resume();
- if(this.status == "normal")
- {
- this.getInstance().play();
- }
- _global.MovieClip.addListener(this.updaterObj);
- }
- function hitTest(aMc, hitEff, hitValue, blockHitEff, blockHitValue, isNoAni, aniFunc)
- {
- var _loc2_ = aMc != undefined ? aMc : this.getInstance().hitBlock;
- hitEff = hitEff != undefined ? hitEff : "Hurt";
- var _loc4_ = blockHitEff != undefined ? blockHitEff : "Block";
- var _loc3_ = Boolean(isNoAni);
- if(_loc2_ != undefined)
- {
- if(Boolean(_loc2_.hitTest(this.opponent.getInstance().hitBody)) && this.opponent.status != "hurt" && !this.opponent.isInvincible && this.opponent.status != "thrown")
- {
- if(this.ani.getDepth() < this.opponent.ani.getDepth())
- {
- this.ani.swapDepths(this.opponent.ani);
- }
- if(this.side == -1 && this.opponent.side == 1 && this.opponent.direction == "left" || this.side == 1 && this.opponent.side == -1 && this.opponent.direction == "right")
- {
- this.dispatchEvent({type:"onFightActivated",activer:this,getHurt:false,blockHitEff:_loc4_,blockHitValue:blockHitValue});
- return -1;
- }
- this.dispatchEvent({type:"onFightActivated",activer:this,getHurt:true,hitEff:hitEff,hurtValue:hitValue,isNoAnimation:_loc3_,hurtFunc:aniFunc});
- return 1;
- }
- }
- return 0;
- }
- function doMotion(evtObj)
- {
- var _loc3_ = evtObj.motion;
- var _loc5_ = evtObj.direction;
- var _loc2_ = "";
- var _loc6_ = undefined;
- var _loc8_ = false;
- if(_loc3_ == "win" || _loc3_ == "lose" || _loc3_ == "intro" || _loc3_ == "hurtUp" || _loc3_ == "hurtDown")
- {
- if(this.status == "skill" && !this._performedSkill.invincible)
- {
- this.setSkillMotionFinished(this._performedSkill);
- _loc8_ = true;
- }
- else if(this.status != "thrown" && this.status != "hurt")
- {
- _loc8_ = true;
- }
- }
- else if(this.status == "punch" || this.status == "kick")
- {
- if(_loc3_ == "down")
- {
- this.direction = "down";
- }
- else if(_loc3_ == "right" || _loc3_ == "left")
- {
- this.direction = "";
- }
- }
- if(this.status == "down" && (_loc5_ == "left" || _loc5_ == "right"))
- {
- this.direction = _loc5_;
- }
- if(_loc8_ || this.status != "jump" && this.status != "punch" && this.status != "kick" && this.status != "hurt" && this.status != "cought" && this.status != "thrown" && this.status != "skill" && this.status != "block")
- {
- if(_loc3_ == "skill" && this.direction != "up")
- {
- if(this.status == "left" || this.status == "right" || this.status == "normal" || this.status == "down")
- {
- var _loc7_ = undefined;
- if(evtObj.isPunch && evtObj.isKick)
- {
- _loc7_ = this.getSkillByName("Throw");
- }
- else
- {
- _loc7_ = this.getSkill(evtObj.skillKeys);
- }
- if(_loc7_ != null)
- {
- _loc2_ = "doSkill";
- _loc6_ = _loc7_.name;
- }
- else if(evtObj.isPunch)
- {
- if(this.status == "down")
- {
- _loc2_ = "mtDownPower";
- }
- else
- {
- _loc2_ = "mtPower";
- }
- }
- else if(evtObj.isKick)
- {
- if(this.status == "down")
- {
- _loc2_ = "mtDownKick";
- }
- else
- {
- _loc2_ = "mtKick";
- }
- }
- }
- }
- else if(_loc3_ == "move")
- {
- if(_loc5_ == "right" && this.status != "right")
- {
- _loc2_ = "movRight";
- }
- else if(_loc5_ == "left" && this.status != "left")
- {
- _loc2_ = "movLeft";
- }
- }
- else if(_loc3_ == "jump" && this.direction != "up")
- {
- if(_loc5_ == "right")
- {
- _loc2_ = "movJumpRight";
- }
- else if(_loc5_ == "left")
- {
- _loc2_ = "movJumpLeft";
- }
- else
- {
- _loc2_ = "movJump";
- }
- }
- else if(_loc3_ == "down" && this.direction != "down" && this.status != "down")
- {
- _loc2_ = "movDown";
- }
- else if(_loc3_ == "hurtUp")
- {
- if(this.status != "hurt")
- {
- if(this.direction == "up" || this.status == "jump")
- {
- _loc2_ = "mtBlastHurt";
- }
- else
- {
- _loc2_ = "mtHurtUp";
- }
- _loc6_ = evtObj.hurtEff;
- }
- }
- else if(_loc3_ == "hurtDown")
- {
- if(this.status != "hurt")
- {
- if(this.direction == "up" || this.status == "jump")
- {
- _loc2_ = "mtBlastHurt";
- }
- else
- {
- _loc2_ = "mtHurtDown";
- }
- _loc6_ = evtObj.hurtEff;
- }
- }
- else if(_loc3_ == "blockUp")
- {
- if(this.status != "block")
- {
- _loc2_ = "mtBlockUp";
- _loc6_ = evtObj.hurtEff;
- }
- }
- else if(_loc3_ == "blockDown")
- {
- if(this.status != "block")
- {
- _loc2_ = "mtBlockDown";
- _loc6_ = evtObj.hurtEff;
- }
- }
- else if(_loc3_ != "cought")
- {
- if(_loc3_ != "thrown")
- {
- if(_loc3_ == "blastHurt")
- {
- _loc2_ = "mtBlastHurt";
- _loc6_ = evtObj.hurtEff;
- }
- else if(_loc3_ == "win")
- {
- _loc2_ = "movWin";
- }
- else if(_loc3_ == "lose")
- {
- if(this.crtHP > 0)
- {
- _loc2_ = "movLoseTimeOut";
- }
- else
- {
- _loc2_ = "movLose";
- }
- }
- else if(_loc3_ == "intro")
- {
- _loc2_ = "movIntro";
- }
- else if(_loc3_ == "normal")
- {
- _loc2_ = "movNormal";
- }
- else if(_loc3_ == "nothing" && evtObj.isDirection)
- {
- if(this.status == "left" || this.status == "right")
- {
- _loc2_ = "movNormal";
- }
- else if(this.status == "down")
- {
- _loc2_ = "movStandUp";
- }
- }
- }
- }
- if(_loc2_ != "")
- {
- if(_loc2_ != "doSkill")
- {
- this.updaterObj.onEnterFrame = undefined;
- }
- this[_loc2_](_loc6_);
- }
- }
- }
- function doSkill(skl)
- {
- if(typeof skl == "string")
- {
- skl = this.getSkillByName(skl);
- }
- if(this._performedSkill != null)
- {
- return undefined;
- }
- if(skl.condition())
- {
- this.updaterObj.onEnterFrame = undefined;
- this.status = "skill";
- this.direction = "";
- var o = this;
- this.onceAni(skl.lable,function()
- {
- o.movNormal();
- o.correctPosition();
- o.correctOffside();
- }
- );
- this.setSkillMotionStarted(skl);
- }
- }
- function setSkillMotionStarted(skl)
- {
- if(skl.type != "call")
- {
- this._performedSkill = skl;
- }
- skl.perform();
- }
- function setSkillMotionFinished(skl)
- {
- if(this.status != "win" || this.status != "lose")
- {
- if(skl.performing)
- {
- this._twnF.stop();
- if(skl.effect != undefined)
- {
- skl.onMotionStopped();
- }
- }
- this._performedSkill = null;
- }
- }
- function getCoughtCondition()
- {
- if(this.HP > 0 && !this.isInvincible && this.status != "thrown" && this.status != "kick" && this.status != "punch" && this.status != "hurt" && this.direction != "up" && Math.abs(this.ani._x - this.opponent.ani._x) < 42)
- {
- if(this._performedSkill != null)
- {
- if(this._performedSkill.type == "self")
- {
- return false;
- }
- }
- return true;
- }
- return false;
- }
- function traceStatus()
- {
- }
- }
-