home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / kung_fu.swf / scripts / __Packages / com / KidFighting / skills / SklScissors.as < prev    next >
Encoding:
Text File  |  2006-06-13  |  1.3 KB  |  42 lines

  1. class com.KidFighting.skills.SklScissors extends com.KidFighting.objects.CSkill
  2. {
  3.    var name;
  4.    var keys;
  5.    var effStartFrame;
  6.    var hurtValue;
  7.    var type;
  8.    var effect;
  9.    var performing;
  10.    var owner;
  11.    function SklScissors()
  12.    {
  13.       super();
  14.       this.name = "Scissors";
  15.       this.keys = com.KidFighting.Input.DOWN + "," + com.KidFighting.Input.RIGHT + "," + com.KidFighting.Input.A;
  16.       this.effStartFrame = 4;
  17.       this.hurtValue = 10;
  18.       this.type = "flyItem";
  19.    }
  20.    function condition()
  21.    {
  22.       return !this.effect.performing && super.condition();
  23.    }
  24.    function perform()
  25.    {
  26.       this.performing = true;
  27.       this.effect = com.KidFighting.EffectSys.generate(this.name,this.owner._twnF,this.owner,this.owner.ani._x + this.owner.side * 5,this.owner.orgY - 35);
  28.       this.effect.effStartFrame = this.effStartFrame;
  29.       this.effect.hurtValue = this.hurtValue;
  30.       this.effect.looping = true;
  31.       this.effect.movingSpeed = this.owner.side * this.effect.movingSpeed;
  32.       this.effect.addEffectListener(this);
  33.       ds.controls.SoundPlayer.playSound("barber_special1");
  34.    }
  35.    function onMotionStopped()
  36.    {
  37.       this.effect.removeEffectListener(this);
  38.       this.performing = false;
  39.       this.owner.setSkillMotionFinished(this);
  40.    }
  41. }
  42.