home *** CD-ROM | disk | FTP | other *** search
- class com.KidFighting.skills.SklTailorRotate extends com.KidFighting.objects.CSkill
- {
- var name;
- var keys;
- var effStartFrame;
- var hurtValue;
- var type;
- var maxHit;
- var owner;
- var performing;
- var hit;
- var movingSpeed;
- var characterMovingSpeed = 12;
- function SklTailorRotate()
- {
- super();
- this.name = "TailorRotate";
- this.keys = com.KidFighting.Input.RIGHT + "," + com.KidFighting.Input.RIGHT + "," + com.KidFighting.Input.A;
- this.effStartFrame = 3;
- this.hurtValue = 18;
- this.type = "self";
- }
- function perform()
- {
- this.maxHit = 3;
- this.owner.startInvincible(0.1);
- this.performing = true;
- this.hit = false;
- this.movingSpeed = this.owner.side * this.characterMovingSpeed;
- this.observeCharacterTween(this.owner._twnF);
- this.onMotionFinished = this.onMotionStopped;
- ds.controls.SoundPlayer.playSound("tailor_special1");
- }
- function onMotionUpdated(twn)
- {
- if(twn.obj._currentframe > this.effStartFrame)
- {
- if(!this.hit)
- {
- this.hit = this.owner.hitTest(this.owner.getInstance().hitBlock,null,this.hurtValue,null,null,true,"mtBlastHurt");
- if(this.hit)
- {
- this.maxHit = this.maxHit - 1;
- }
- }
- else if(this.maxHit-- > 0)
- {
- if(this.hit == 1)
- {
- this.owner.opponent.mtBlastHurt("Hurt");
- }
- else
- {
- this.hit = this.owner.hitTest(this.owner.getInstance().hitBlock,null,this.hurtValue,null,null,true,"mtBlastHurt");
- }
- }
- this.owner.ani._x += this.movingSpeed;
- if(this.owner.opponent.direction != "up")
- {
- this.owner.correctPosition();
- }
- this.owner.correctOffside();
- }
- }
- function onMotionStopped()
- {
- this.unobserveCharacterTween(this.owner._twnF);
- this.performing = false;
- this.owner.setSkillMotionFinished(this);
- }
- }
-