Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,179 @@
|
||||
package net.pixvi.myr.view.skillobj
|
||||
{
|
||||
import flash.geom.Point;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.battle.BattleGround;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.display.PiSprite;
|
||||
import net.pixvi.pfw.utils.Locator;
|
||||
import net.pixvi.pfw.utils.Pointer;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class BounceBubble extends PiSprite
|
||||
{
|
||||
|
||||
public var mc_bubble:BitMovieClip;
|
||||
|
||||
public var moveSpd:int = 8;
|
||||
|
||||
public var target:BattleMon;
|
||||
|
||||
public var owner:BattleMon;
|
||||
|
||||
public var para:Object;
|
||||
|
||||
public var jumpCount:int = 0;
|
||||
|
||||
public var lastTeam:int = -1;
|
||||
|
||||
public var shouldDispose:Boolean = false;
|
||||
|
||||
public var targetPos:Point;
|
||||
|
||||
public var isFirstHit:Boolean = true;
|
||||
|
||||
public function BounceBubble(owner:BattleMon, target:BattleMon, para:Object)
|
||||
{
|
||||
super();
|
||||
this.owner = owner;
|
||||
this.target = target;
|
||||
this.para = para;
|
||||
this.x = owner.x;
|
||||
this.y = owner.y;
|
||||
if(target != null)
|
||||
{
|
||||
this.targetPos = new Point(target.x,target.y);
|
||||
}
|
||||
mc_bubble = FF.getBMC("mov.skill212",30);
|
||||
addChild(mc_bubble);
|
||||
}
|
||||
|
||||
public function step() : Boolean
|
||||
{
|
||||
if(target != null && !target.monVo.dead)
|
||||
{
|
||||
targetPos.x = target.x;
|
||||
targetPos.y = target.y;
|
||||
}
|
||||
if(targetPos == null)
|
||||
{
|
||||
shouldDispose = true;
|
||||
return true;
|
||||
}
|
||||
var newP:Point = Pointer.Point2Point(new Point(this.x,this.y),targetPos,moveSpd,true);
|
||||
if(isNaN(newP.x) || isNaN(newP.y) || newP.x <= 0 || newP.y <= 0)
|
||||
{
|
||||
shouldDispose = true;
|
||||
return true;
|
||||
}
|
||||
if(isOutOfBounds(newP.x,newP.y))
|
||||
{
|
||||
shouldDispose = true;
|
||||
return true;
|
||||
}
|
||||
this.x = newP.x;
|
||||
this.y = newP.y;
|
||||
if(Locator.getPow(this.x,this.y,targetPos.x,targetPos.y) <= moveSpd * moveSpd)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private function isOutOfBounds(px:Number, py:Number) : Boolean
|
||||
{
|
||||
if(BattlePanel.getIns() == null || BattlePanel.getIns().ground == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var ground:BattleGround = BattlePanel.getIns().ground;
|
||||
if(ground.vo == null || ground.vo.mapAreas == null || ground.vo.mapAreas.area_battlefield == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var boardarea:Object = ground.vo.mapAreas.area_battlefield;
|
||||
var minX:Number = Number(boardarea.x);
|
||||
var maxX:Number = boardarea.x + boardarea.w;
|
||||
var minY:Number = Number(boardarea.y);
|
||||
var maxY:Number = boardarea.y + boardarea.h;
|
||||
return px < minX || px > maxX || py < minY || py > maxY;
|
||||
}
|
||||
|
||||
public function hitTarget() : void
|
||||
{
|
||||
var cureAmount:int = 0;
|
||||
var damageAmount:int = 0;
|
||||
var nextTarget:BattleMon = null;
|
||||
BattleGround.getIns().addMovInGround("mov.hit51big",30,this.x,this.y - 130,2.2,2.2,0,1,true);
|
||||
SoundCenter.getIns().play(GameSound.soundName("hit_waterWave"),0.6);
|
||||
var isTargetAlive:Boolean = target != null && !target.monVo.dead;
|
||||
if(isTargetAlive)
|
||||
{
|
||||
if(target.team == owner.team)
|
||||
{
|
||||
cureAmount = owner.all_atk * para.cure;
|
||||
target.beCure(1,cureAmount);
|
||||
}
|
||||
else
|
||||
{
|
||||
damageAmount = owner.all_atk * para.atkAdd;
|
||||
target.beHurt(1,owner,damageAmount,false,false,3,this.x,this.y);
|
||||
}
|
||||
jumpCount++;
|
||||
}
|
||||
if(isFirstHit || jumpCount < para.jumpNum)
|
||||
{
|
||||
isFirstHit = false;
|
||||
nextTarget = findNextTarget();
|
||||
if(nextTarget != null)
|
||||
{
|
||||
target = nextTarget;
|
||||
targetPos = new Point(target.x,target.y);
|
||||
return;
|
||||
}
|
||||
}
|
||||
shouldDispose = true;
|
||||
}
|
||||
|
||||
private function findNextTarget() : BattleMon
|
||||
{
|
||||
var candidates:Array = BattleGround.getIns().findMonsByPointNear(this.x,this.y,500,500,-1);
|
||||
var validTargets:Array = [];
|
||||
for each(var mon:BattleMon in candidates)
|
||||
{
|
||||
if(mon != target && !mon.monVo.dead)
|
||||
{
|
||||
validTargets.push(mon);
|
||||
}
|
||||
}
|
||||
if(validTargets.length == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return Random.element(validTargets) as BattleMon;
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
if(parent != null)
|
||||
{
|
||||
parent.removeChild(this);
|
||||
}
|
||||
if(mc_bubble != null)
|
||||
{
|
||||
mc_bubble.dispose();
|
||||
mc_bubble = null;
|
||||
}
|
||||
target = null;
|
||||
owner = null;
|
||||
para = null;
|
||||
targetPos = null;
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
package net.pixvi.myr.view.skillobj
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Back;
|
||||
import com.greensock.easing.Elastic;
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.Event;
|
||||
import flash.geom.Rectangle;
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.display.PiSprite;
|
||||
|
||||
public class ButterFlyBeam extends PiSprite
|
||||
{
|
||||
|
||||
public var mc_flash:BitMovieClip;
|
||||
|
||||
public var mc_line:MovieClip;
|
||||
|
||||
public var hitCd:Cooldowner;
|
||||
|
||||
public var leftNum:int = 4;
|
||||
|
||||
public var faceTo:int;
|
||||
|
||||
public var start:Boolean = false;
|
||||
|
||||
public function ButterFlyBeam(time:int = 4, space:Number = 0.25, faceto:int = 1, mode:int = 1)
|
||||
{
|
||||
this.leftNum = time / space;
|
||||
this.faceTo = faceto;
|
||||
super();
|
||||
if(this.faceTo == 1)
|
||||
{
|
||||
this.scaleX = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.scaleX = 1;
|
||||
}
|
||||
hitCd = new Cooldowner(space * 1000);
|
||||
if(mode == 2)
|
||||
{
|
||||
mc_flash = FF.getBMC("mov.skill188Light2");
|
||||
mc_line = FF.getMC("mov.skill188Line2");
|
||||
}
|
||||
else
|
||||
{
|
||||
mc_flash = FF.getBMC("mov.skill188Light");
|
||||
mc_line = FF.getMC("mov.skill188Line");
|
||||
}
|
||||
mc_line.getChildByName("mc_line").scaleX = 10;
|
||||
mc_flash.scaleX = mc_flash.scaleY = 2;
|
||||
mc_flash.alpha = 0;
|
||||
mc_line.scaleY = 0.2;
|
||||
TweenMax.to(mc_line,1,{
|
||||
"scaleY":1,
|
||||
"ease":Elastic.easeInOut
|
||||
});
|
||||
TweenMax.to(mc_flash,1,{
|
||||
"scaleX":1,
|
||||
"scaleY":1,
|
||||
"alpha":1,
|
||||
"ease":Back.easeIn,
|
||||
"onComplete":startHandler
|
||||
});
|
||||
mc_line.y = -100;
|
||||
mc_flash.y = -100;
|
||||
addChild(mc_line);
|
||||
addChild(mc_flash);
|
||||
}
|
||||
|
||||
public function startHandler(e:Event = null) : void
|
||||
{
|
||||
this.start = true;
|
||||
}
|
||||
|
||||
public function getDamageRect() : Rectangle
|
||||
{
|
||||
var rec:Rectangle = null;
|
||||
if(faceTo == 1)
|
||||
{
|
||||
rec = new Rectangle(this.x - 2000,this.y - 50,2000,100);
|
||||
}
|
||||
else
|
||||
{
|
||||
rec = new Rectangle(this.x,this.y - 50,2000,100);
|
||||
}
|
||||
return rec;
|
||||
}
|
||||
|
||||
public function close() : void
|
||||
{
|
||||
TweenMax.to(mc_line,0.5,{"scaleY":0.2});
|
||||
TweenMax.to(mc_flash,0.5,{
|
||||
"scaleX":0.5,
|
||||
"scaleY":0.5,
|
||||
"alpha":0,
|
||||
"onComplete":this.dispose
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,217 @@
|
||||
package net.pixvi.myr.view.skillobj
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Linear;
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.battle.BattleGround;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
|
||||
public class DeepLantern
|
||||
{
|
||||
|
||||
private static const FLY_TIME:Number = 0.5;
|
||||
|
||||
private static const ARC_HEIGHT:Number = 160;
|
||||
|
||||
private static const FLY_SCALE:Number = 0.5;
|
||||
|
||||
private static const LANTERN_SCALE:Number = 1.2;
|
||||
|
||||
private static const PULL_INTERVAL:int = 200;
|
||||
|
||||
private static const FADE_OUT:Number = 0.4;
|
||||
|
||||
public var x:Number;
|
||||
|
||||
public var y:Number;
|
||||
|
||||
public var mc_lantern:BitMovieClip;
|
||||
|
||||
public var over:Boolean = false;
|
||||
|
||||
private var lifeCd:Cooldowner;
|
||||
|
||||
private var flashCd:Cooldowner;
|
||||
|
||||
private var pullCd:Cooldowner;
|
||||
|
||||
private var started:Boolean = false;
|
||||
|
||||
private var paused:Boolean = false;
|
||||
|
||||
private var fromX:Number;
|
||||
|
||||
private var fromY:Number;
|
||||
|
||||
public var flyP:Number = 0;
|
||||
|
||||
private var onFlash:Function;
|
||||
|
||||
private var onPull:Function;
|
||||
|
||||
private var onFinal:Function;
|
||||
|
||||
public function DeepLantern(fromX:Number, fromY:Number, toX:Number, toY:Number, lifeTime:int, interval:int, onFlash:Function, onPull:Function, onFinal:Function)
|
||||
{
|
||||
super();
|
||||
this.fromX = fromX;
|
||||
this.fromY = fromY;
|
||||
this.x = toX;
|
||||
this.y = toY;
|
||||
this.onFlash = onFlash;
|
||||
this.onPull = onPull;
|
||||
this.onFinal = onFinal;
|
||||
lifeCd = new Cooldowner(lifeTime);
|
||||
flashCd = new Cooldowner(interval);
|
||||
pullCd = new Cooldowner(200);
|
||||
mc_lantern = FF.getBMC("mov.skill264lightfire",12);
|
||||
mc_lantern.mouseChildren = mc_lantern.mouseEnabled = false;
|
||||
BattleGround.getIns().container.addChild(mc_lantern);
|
||||
updateFly();
|
||||
TweenMax.to(this,0.5,{
|
||||
"flyP":1,
|
||||
"ease":Linear.easeNone,
|
||||
"onUpdate":updateFly
|
||||
});
|
||||
}
|
||||
|
||||
private function updateFly() : void
|
||||
{
|
||||
if(mc_lantern == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
mc_lantern.x = fromX + (x - fromX) * flyP;
|
||||
mc_lantern.y = fromY + (y - fromY) * flyP - Math.sin(flyP * 3.141592653589793) * 160;
|
||||
mc_lantern.setScale(0.5 + (1.2 - 0.5) * flyP);
|
||||
}
|
||||
|
||||
public function start() : void
|
||||
{
|
||||
if(started || over)
|
||||
{
|
||||
return;
|
||||
}
|
||||
started = true;
|
||||
lifeCd.activity();
|
||||
}
|
||||
|
||||
public function step() : void
|
||||
{
|
||||
if(!started || over || paused)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(lifeCd.cooldown)
|
||||
{
|
||||
if(onFinal != null)
|
||||
{
|
||||
onFinal(this);
|
||||
}
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
if(pullCd.cooldown)
|
||||
{
|
||||
pullCd.activity();
|
||||
if(onPull != null)
|
||||
{
|
||||
onPull(this);
|
||||
}
|
||||
}
|
||||
if(flashCd.cooldown)
|
||||
{
|
||||
flashCd.activity();
|
||||
if(onFlash != null)
|
||||
{
|
||||
onFlash(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function finish() : void
|
||||
{
|
||||
over = true;
|
||||
clearCallbacks();
|
||||
if(mc_lantern != null)
|
||||
{
|
||||
TweenMax.killTweensOf(this);
|
||||
TweenMax.to(mc_lantern,0.4,{
|
||||
"alpha":0,
|
||||
"scaleX":1.2 * 1.5,
|
||||
"scaleY":1.2 * 1.5,
|
||||
"onComplete":disposeMovie
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function pause() : void
|
||||
{
|
||||
if(paused || over)
|
||||
{
|
||||
return;
|
||||
}
|
||||
paused = true;
|
||||
lifeCd.pause();
|
||||
flashCd.pause();
|
||||
pullCd.pause();
|
||||
if(mc_lantern != null)
|
||||
{
|
||||
mc_lantern.stop();
|
||||
}
|
||||
}
|
||||
|
||||
public function resume() : void
|
||||
{
|
||||
if(!paused || over)
|
||||
{
|
||||
return;
|
||||
}
|
||||
paused = false;
|
||||
lifeCd.resume();
|
||||
flashCd.resume();
|
||||
pullCd.resume();
|
||||
if(mc_lantern != null)
|
||||
{
|
||||
mc_lantern.play();
|
||||
}
|
||||
}
|
||||
|
||||
public function kill() : void
|
||||
{
|
||||
if(over)
|
||||
{
|
||||
return;
|
||||
}
|
||||
over = true;
|
||||
clearCallbacks();
|
||||
TweenMax.killTweensOf(this);
|
||||
if(mc_lantern != null)
|
||||
{
|
||||
TweenMax.to(mc_lantern,0.4,{
|
||||
"alpha":0,
|
||||
"onComplete":disposeMovie
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private function clearCallbacks() : void
|
||||
{
|
||||
onFlash = null;
|
||||
onPull = null;
|
||||
onFinal = null;
|
||||
}
|
||||
|
||||
private function disposeMovie() : void
|
||||
{
|
||||
if(mc_lantern != null)
|
||||
{
|
||||
TweenMax.killTweensOf(mc_lantern);
|
||||
mc_lantern.dispose();
|
||||
mc_lantern = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package net.pixvi.myr.view.skillobj
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.display.PiSprite;
|
||||
import net.pixvi.pfw.utils.Director;
|
||||
|
||||
public class FallenSword extends PiSprite
|
||||
{
|
||||
|
||||
public var mc_swd:MovieClip;
|
||||
|
||||
public var mc_dust:BitMovieClip;
|
||||
|
||||
public var onHit:Function;
|
||||
|
||||
public var target:BattleMon;
|
||||
|
||||
public var skin:String = "";
|
||||
|
||||
public function FallenSword(onHit:Function, skin:String = "")
|
||||
{
|
||||
super();
|
||||
this.skin = skin;
|
||||
this.onHit = onHit;
|
||||
mc_swd = FF.getMC("mov.Skill165Start" + skin);
|
||||
mc_dust = FF.getBMC("mov.Skill165Dust");
|
||||
addChild(mc_swd);
|
||||
mc_swd.addEventListener("hit",onHitHandler);
|
||||
}
|
||||
|
||||
public function onHitHandler(e:Event = null) : void
|
||||
{
|
||||
onHit(this);
|
||||
}
|
||||
|
||||
public function showHit() : void
|
||||
{
|
||||
var mc_hit:BitMovieClip = FF.getBMC("mov.Skill165Hit" + skin);
|
||||
addChild(mc_hit);
|
||||
Director.playOnce(mc_hit,mc_hit.dispose);
|
||||
}
|
||||
|
||||
public function showOut() : void
|
||||
{
|
||||
TweenMax.to(this,1,{
|
||||
"alpha":0,
|
||||
"onComplete":showOutEnd
|
||||
});
|
||||
TweenMax.to(mc_dust,1,{
|
||||
"alpha":0,
|
||||
"onComplete":showOutEnd
|
||||
});
|
||||
}
|
||||
|
||||
public function showOutEnd() : void
|
||||
{
|
||||
mc_dust.dispose();
|
||||
target = null;
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
target = null;
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,220 @@
|
||||
package net.pixvi.myr.view.skillobj
|
||||
{
|
||||
import com.greensock.TimelineMax;
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Cubic;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.battle.BattleGround;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.display.PiSprite;
|
||||
import net.pixvi.pfw.utils.Locator;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class FireBall extends PiSprite
|
||||
{
|
||||
|
||||
public var mc_ball:BitMovieClip;
|
||||
|
||||
public var target:BattleMon;
|
||||
|
||||
public var owner:BattleMon;
|
||||
|
||||
public var para:Object;
|
||||
|
||||
public var chainLeft:int = 0;
|
||||
|
||||
public var shouldDispose:Boolean = false;
|
||||
|
||||
public var onCreatePool:Function;
|
||||
|
||||
public var tweenMove:TweenMax;
|
||||
|
||||
public var tweenArc:TimelineMax;
|
||||
|
||||
public var arcHeight:Number = 230;
|
||||
|
||||
public function FireBall(owner:BattleMon, target:BattleMon, para:Object, onCreatePool:Function)
|
||||
{
|
||||
super();
|
||||
this.owner = owner;
|
||||
this.target = target;
|
||||
this.para = para;
|
||||
this.chainLeft = para.chainNum;
|
||||
this.onCreatePool = onCreatePool;
|
||||
this.x = owner.x;
|
||||
this.y = owner.y;
|
||||
addChild(FF.getMC("mov.BulletShadow"));
|
||||
mc_ball = FF.getBMC("mov.skll258fireball",12);
|
||||
addChild(mc_ball);
|
||||
if(owner.x < target.x)
|
||||
{
|
||||
mc_ball.scaleX = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
mc_ball.scaleX = -1;
|
||||
}
|
||||
flyTo(target);
|
||||
}
|
||||
|
||||
public function flyTo(t:BattleMon) : void
|
||||
{
|
||||
if(mc_ball.scaleX > 0)
|
||||
{
|
||||
mc_ball.rotation = -70;
|
||||
}
|
||||
else
|
||||
{
|
||||
mc_ball.rotation = 70;
|
||||
}
|
||||
target = t;
|
||||
var tx:Number = target.x + Random.integer(-50,50);
|
||||
var ty:Number = target.y + Random.integer(-25,25);
|
||||
var dist:Number = Locator.getLength(this.x,this.y,tx,ty);
|
||||
var duration:Number = dist / 150;
|
||||
if(duration < 1)
|
||||
{
|
||||
duration = 0.8;
|
||||
}
|
||||
if(duration > 2)
|
||||
{
|
||||
duration = 1.6;
|
||||
}
|
||||
tweenMove = TweenMax.to(this,duration,{
|
||||
"x":tx,
|
||||
"y":ty,
|
||||
"onComplete":onArrive
|
||||
});
|
||||
tweenArc = new TimelineMax();
|
||||
tweenArc.to(mc_ball,duration / 2,{
|
||||
"y":-arcHeight,
|
||||
"ease":Cubic.easeOut,
|
||||
"rotation":0
|
||||
});
|
||||
if(mc_ball.scaleX > 0)
|
||||
{
|
||||
tweenArc.to(mc_ball,duration / 2,{
|
||||
"y":0,
|
||||
"ease":Cubic.easeIn,
|
||||
"rotation":70
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
tweenArc.to(mc_ball,duration / 2,{
|
||||
"y":0,
|
||||
"ease":Cubic.easeIn,
|
||||
"rotation":-70
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private function onArrive() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var emon:BattleMon = null;
|
||||
var nextTarget:BattleMon = null;
|
||||
mc_ball.y = 0;
|
||||
BattleGround.getIns().addMovInGround("mov.skill258Boom",30,this.x,this.y - 60,1.5,1.5,0,1,true);
|
||||
SoundCenter.getIns().play(GameSound.soundName("skill_fireboom"));
|
||||
var damage:int = owner.all_atk * para.atkAdd;
|
||||
var enemys:Array = BattleGround.getIns().findMonsByPointNear(this.x,this.y,200,200,owner.team);
|
||||
for(i = 0; i < enemys.length; )
|
||||
{
|
||||
emon = enemys[i];
|
||||
emon.beHurt(1,owner,damage,false,false,2,this.x,this.y);
|
||||
i++;
|
||||
}
|
||||
if(onCreatePool != null)
|
||||
{
|
||||
onCreatePool(this.x,this.y);
|
||||
}
|
||||
chainLeft--;
|
||||
if(chainLeft >= 0)
|
||||
{
|
||||
nextTarget = findNextTarget();
|
||||
if(nextTarget != null)
|
||||
{
|
||||
SoundCenter.getIns().play(GameSound.soundName("effect_fireShoot"));
|
||||
flyTo(nextTarget);
|
||||
return;
|
||||
}
|
||||
}
|
||||
shouldDispose = true;
|
||||
}
|
||||
|
||||
private function findNextTarget() : BattleMon
|
||||
{
|
||||
var candidates:Array = BattleGround.getIns().findMonsByPointNear(this.x,this.y,500,500,owner.team);
|
||||
var validTargets:Array = [];
|
||||
for each(var mon:BattleMon in candidates)
|
||||
{
|
||||
if(mon != target && !mon.monVo.dead)
|
||||
{
|
||||
validTargets.push(mon);
|
||||
}
|
||||
}
|
||||
if(validTargets.length == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return Random.element(validTargets) as BattleMon;
|
||||
}
|
||||
|
||||
public function pauseTween() : void
|
||||
{
|
||||
if(tweenMove != null)
|
||||
{
|
||||
tweenMove.pause();
|
||||
}
|
||||
if(tweenArc != null)
|
||||
{
|
||||
tweenArc.pause();
|
||||
}
|
||||
}
|
||||
|
||||
public function resumeTween() : void
|
||||
{
|
||||
if(tweenMove != null)
|
||||
{
|
||||
tweenMove.resume();
|
||||
}
|
||||
if(tweenArc != null)
|
||||
{
|
||||
tweenArc.resume();
|
||||
}
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
if(tweenMove != null)
|
||||
{
|
||||
tweenMove.kill();
|
||||
tweenMove = null;
|
||||
}
|
||||
if(tweenArc != null)
|
||||
{
|
||||
tweenArc.kill();
|
||||
tweenArc = null;
|
||||
}
|
||||
if(parent != null)
|
||||
{
|
||||
parent.removeChild(this);
|
||||
}
|
||||
if(mc_ball != null)
|
||||
{
|
||||
mc_ball.dispose();
|
||||
mc_ball = null;
|
||||
}
|
||||
target = null;
|
||||
owner = null;
|
||||
para = null;
|
||||
onCreatePool = null;
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package net.pixvi.myr.view.skillobj
|
||||
{
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.display.PiSprite;
|
||||
|
||||
public class FlySword extends PiSprite
|
||||
{
|
||||
|
||||
public var mc_sword:BitMovieClip;
|
||||
|
||||
public var faceTo:int = 0;
|
||||
|
||||
public var over:Boolean = false;
|
||||
|
||||
public var spd:Number = 10;
|
||||
|
||||
public function FlySword(heroFaceTo:int, addFix:String = "")
|
||||
{
|
||||
super();
|
||||
this.faceTo = heroFaceTo;
|
||||
mc_sword = FF.getBMC("mov.skill219SwordSmall" + addFix);
|
||||
mc_sword.scaleX = faceTo;
|
||||
addChild(mc_sword);
|
||||
}
|
||||
|
||||
public function step() : void
|
||||
{
|
||||
this.x += faceTo * spd;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package net.pixvi.myr.view.skillobj
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.display.MovieClip;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.display.PiSprite;
|
||||
|
||||
public class LightArrow extends PiSprite
|
||||
{
|
||||
|
||||
public var mc_arrow:BitMovieClip;
|
||||
|
||||
public var mc_shadow:MovieClip;
|
||||
|
||||
public var rota:Number = 0;
|
||||
|
||||
public function LightArrow(rotation:int)
|
||||
{
|
||||
super();
|
||||
this.rota = rotation;
|
||||
var shadow:Sprite = FF.getBS("img.Shadow");
|
||||
shadow.scaleX = shadow.scaleY = 0.5;
|
||||
addChild(shadow);
|
||||
mc_arrow = FF.getBMC("mov.skill202",24);
|
||||
addChild(mc_arrow);
|
||||
mc_arrow.rotation = rotation;
|
||||
mc_arrow.y = -60;
|
||||
mc_arrow.setScale(0.7);
|
||||
TweenMax.from(mc_arrow,0.4,{
|
||||
"scaleX":0.1,
|
||||
"scaleY":0.1
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package net.pixvi.myr.view.skillobj
|
||||
{
|
||||
import flash.geom.Point;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.display.PiSprite;
|
||||
import net.pixvi.pfw.utils.Angler;
|
||||
|
||||
public class MoveHorseShadow extends PiSprite
|
||||
{
|
||||
|
||||
public var mc_img:BitMovieClip;
|
||||
|
||||
public var moveSpd:Number = 0;
|
||||
|
||||
public var rota:Number;
|
||||
|
||||
public function MoveHorseShadow(type:String = "a", moveSpd:int = 3, rota:Number = 0)
|
||||
{
|
||||
super();
|
||||
if(type == "a")
|
||||
{
|
||||
mc_img = FF.getBMC("mov.skill245ShadowHouse",24);
|
||||
}
|
||||
this.moveSpd = moveSpd;
|
||||
this.rota = rota;
|
||||
addChild(mc_img);
|
||||
}
|
||||
|
||||
public function step() : Boolean
|
||||
{
|
||||
moveSpd += 0.1;
|
||||
var np:Point = Angler.getPointByRotation(this.x,this.y,rota,moveSpd);
|
||||
this.x = np.x;
|
||||
this.y = np.y;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package net.pixvi.myr.view.skillobj
|
||||
{
|
||||
import flash.geom.Point;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.display.PiSprite;
|
||||
import net.pixvi.pfw.utils.Locator;
|
||||
import net.pixvi.pfw.utils.Pointer;
|
||||
|
||||
public class MoveTargetBubble extends PiSprite
|
||||
{
|
||||
|
||||
public var mc_bubble:BitMovieClip;
|
||||
|
||||
public var moveSpd:int = 0;
|
||||
|
||||
public var target:BattleMon;
|
||||
|
||||
public function MoveTargetBubble(type:String = "a", moveSpd:int = 3, target:BattleMon = null)
|
||||
{
|
||||
super();
|
||||
if(type == "a")
|
||||
{
|
||||
mc_bubble = FF.getBMC("mov.skill212",24);
|
||||
}
|
||||
this.moveSpd = moveSpd;
|
||||
this.target = target;
|
||||
addChild(mc_bubble);
|
||||
}
|
||||
|
||||
public function step() : Boolean
|
||||
{
|
||||
var newP:Point = Pointer.Point2Point(new Point(this.x,this.y),target.getPos(),moveSpd,true);
|
||||
this.x = newP.x;
|
||||
this.y = newP.y;
|
||||
if(Locator.getPow(this.x,this.y,target.x,target.y) <= moveSpd * moveSpd)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,222 @@
|
||||
package net.pixvi.myr.view.skillobj
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.battle.BattleGround;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class PhantomSpore
|
||||
{
|
||||
|
||||
private static const FADE_IN:int = 350;
|
||||
|
||||
private static const FADE_OUT:int = 1000;
|
||||
|
||||
private static const KILL_FADE:Number = 0.4;
|
||||
|
||||
private static const INFECT_INTERVAL:int = 1000;
|
||||
|
||||
private static const GROUND_SCALE:Number = 2;
|
||||
|
||||
private static const SMOKE_SCALE:Number = 1.2;
|
||||
|
||||
private static const DRIFT_RANGE:Number = 80;
|
||||
|
||||
private static const STRETCH:Number = 0.4;
|
||||
|
||||
private static const START_SCALE:Number = 0.3;
|
||||
|
||||
public var x:Number;
|
||||
|
||||
public var y:Number;
|
||||
|
||||
public var mc_ground:BitMovieClip;
|
||||
|
||||
public var mc_smoke:BitMovieClip;
|
||||
|
||||
public var over:Boolean = false;
|
||||
|
||||
private var lifeCd:Cooldowner;
|
||||
|
||||
private var fadeCd:Cooldowner;
|
||||
|
||||
private var infectCd:Cooldowner;
|
||||
|
||||
private var fading:Boolean = false;
|
||||
|
||||
private var paused:Boolean = false;
|
||||
|
||||
private var sporeTime:int;
|
||||
|
||||
private var groundDir:int;
|
||||
|
||||
private var smokeDir:int;
|
||||
|
||||
private var ox:Number;
|
||||
|
||||
private var freq1:Number;
|
||||
|
||||
private var freq2:Number;
|
||||
|
||||
private var phase1:Number;
|
||||
|
||||
private var phase2:Number;
|
||||
|
||||
private var onInfect:Function;
|
||||
|
||||
public function PhantomSpore(px:Number, py:Number, sporeTime:int, onInfect:Function)
|
||||
{
|
||||
super();
|
||||
this.x = px;
|
||||
this.y = py;
|
||||
this.sporeTime = sporeTime;
|
||||
this.onInfect = onInfect;
|
||||
groundDir = Random.direction();
|
||||
smokeDir = Random.direction();
|
||||
ox = px;
|
||||
freq1 = Random.number(0.4,0.8);
|
||||
freq2 = Random.number(1.1,1.7);
|
||||
phase1 = Random.number(0,3.141592653589793 * 2);
|
||||
phase2 = Random.number(0,3.141592653589793 * 2);
|
||||
mc_ground = FF.getBMC("mov.skill263spore",30);
|
||||
mc_ground.y = py;
|
||||
mc_ground.mouseChildren = mc_ground.mouseEnabled = false;
|
||||
BattleGround.getIns().containerBottom.addChild(mc_ground);
|
||||
mc_smoke = FF.getBMC("mov.skill263sporeSmoke",30);
|
||||
mc_smoke.y = py;
|
||||
mc_smoke.mouseChildren = mc_smoke.mouseEnabled = false;
|
||||
BattleGround.getIns().container.addChild(mc_smoke);
|
||||
lifeCd = new Cooldowner(sporeTime);
|
||||
lifeCd.activity();
|
||||
fadeCd = new Cooldowner(1000);
|
||||
infectCd = new Cooldowner(1000);
|
||||
GameSound.playEffect("skill_darkSmokeBurst",0.8);
|
||||
updateView();
|
||||
}
|
||||
|
||||
public function step() : void
|
||||
{
|
||||
if(over || paused)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(!fading)
|
||||
{
|
||||
if(infectCd.cooldown)
|
||||
{
|
||||
infectCd.activity();
|
||||
if(onInfect != null)
|
||||
{
|
||||
onInfect(this);
|
||||
}
|
||||
}
|
||||
if(lifeCd.cooldown)
|
||||
{
|
||||
fading = true;
|
||||
fadeCd.activity();
|
||||
}
|
||||
}
|
||||
else if(fadeCd.cooldown)
|
||||
{
|
||||
dispose();
|
||||
return;
|
||||
}
|
||||
updateView();
|
||||
}
|
||||
|
||||
private function updateView() : void
|
||||
{
|
||||
var inP:Number = Math.min(1,lifeCd.passTime / 350);
|
||||
inP = 1 - Math.pow(1 - inP,3);
|
||||
var s:Number = 0.3 + (1 - 0.3) * inP;
|
||||
var passed:Number = lifeCd.passTime + (fading ? fadeCd.passTime : 0);
|
||||
var stretch:Number = 1 + 0.4 * passed / sporeTime;
|
||||
var t:Number = passed / 1000;
|
||||
var drift:Number = Math.sin(t * freq1 + phase1) - Math.sin(phase1) + 0.5 * (Math.sin(t * freq2 + phase2) - Math.sin(phase2));
|
||||
x = ox + 80 * drift / 3;
|
||||
var a:Number = inP;
|
||||
if(fading)
|
||||
{
|
||||
a *= 1 - fadeCd.passTime / 1000;
|
||||
}
|
||||
mc_ground.x = x;
|
||||
mc_ground.scaleX = 2 * s * stretch * groundDir;
|
||||
mc_ground.scaleY = 2 * s;
|
||||
mc_ground.alpha = a;
|
||||
mc_smoke.x = x;
|
||||
mc_smoke.scaleX = 1.2 * s * smokeDir;
|
||||
mc_smoke.scaleY = 1.2 * s;
|
||||
mc_smoke.alpha = a;
|
||||
}
|
||||
|
||||
public function pause() : void
|
||||
{
|
||||
if(paused || over)
|
||||
{
|
||||
return;
|
||||
}
|
||||
paused = true;
|
||||
lifeCd.pause();
|
||||
fadeCd.pause();
|
||||
infectCd.pause();
|
||||
mc_ground.stop();
|
||||
mc_smoke.stop();
|
||||
}
|
||||
|
||||
public function resume() : void
|
||||
{
|
||||
if(!paused || over)
|
||||
{
|
||||
return;
|
||||
}
|
||||
paused = false;
|
||||
lifeCd.resume();
|
||||
fadeCd.resume();
|
||||
infectCd.resume();
|
||||
mc_ground.play();
|
||||
mc_smoke.play();
|
||||
}
|
||||
|
||||
public function kill() : void
|
||||
{
|
||||
if(over)
|
||||
{
|
||||
return;
|
||||
}
|
||||
over = true;
|
||||
onInfect = null;
|
||||
TweenMax.to(mc_ground,0.4,{
|
||||
"alpha":0,
|
||||
"onComplete":disposeMovies
|
||||
});
|
||||
TweenMax.to(mc_smoke,0.4,{"alpha":0});
|
||||
}
|
||||
|
||||
public function dispose() : void
|
||||
{
|
||||
over = true;
|
||||
onInfect = null;
|
||||
disposeMovies();
|
||||
}
|
||||
|
||||
private function disposeMovies() : void
|
||||
{
|
||||
if(mc_ground != null)
|
||||
{
|
||||
TweenMax.killTweensOf(mc_ground);
|
||||
mc_ground.dispose();
|
||||
mc_ground = null;
|
||||
}
|
||||
if(mc_smoke != null)
|
||||
{
|
||||
TweenMax.killTweensOf(mc_smoke);
|
||||
mc_smoke.dispose();
|
||||
mc_smoke = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package net.pixvi.myr.view.skillobj
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
|
||||
public class RabbitData
|
||||
{
|
||||
|
||||
public var rabbit:BattleMon;
|
||||
|
||||
public var jumpCder:Cooldowner;
|
||||
|
||||
public var flameCder:Cooldowner;
|
||||
|
||||
public function RabbitData(rabbit:BattleMon, jumpInterval:Number)
|
||||
{
|
||||
super();
|
||||
this.rabbit = rabbit;
|
||||
this.jumpCder = new Cooldowner(jumpInterval * 1000);
|
||||
this.jumpCder.activity();
|
||||
this.flameCder = new Cooldowner(500);
|
||||
this.flameCder.activity();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
package net.pixvi.myr.view.skillobj
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.battle.BattleGround;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.display.PiSprite;
|
||||
import net.pixvi.pfw.driver.EnterFrameDriver;
|
||||
|
||||
public class RhythmNote
|
||||
{
|
||||
|
||||
private static const SPEED:Number = 400;
|
||||
|
||||
private static const FLOAT_HEIGHT:Number = 60;
|
||||
|
||||
private static const FADE_IN:int = 300;
|
||||
|
||||
private static const FADE_OUT:Number = 0.2;
|
||||
|
||||
private static const MAX_DT:int = 100;
|
||||
|
||||
public var x:Number;
|
||||
|
||||
public var y:Number;
|
||||
|
||||
public var wave:int = 0;
|
||||
|
||||
public var finished:Boolean = false;
|
||||
|
||||
public var over:Boolean = false;
|
||||
|
||||
private var holder:PiSprite;
|
||||
|
||||
private var mc_note:BitMovieClip;
|
||||
|
||||
private var dir:int;
|
||||
|
||||
private var leftDis:Number;
|
||||
|
||||
private var age:int = 0;
|
||||
|
||||
private var paused:Boolean = false;
|
||||
|
||||
public function RhythmNote(px:Number, py:Number, dir:int, flyDis:Number)
|
||||
{
|
||||
super();
|
||||
x = px;
|
||||
y = py;
|
||||
this.dir = dir >= 0 ? 1 : -1;
|
||||
leftDis = flyDis;
|
||||
mc_note = FF.getBMC("mov.skill266block",24);
|
||||
mc_note.y = -60;
|
||||
mc_note.mouseChildren = mc_note.mouseEnabled = false;
|
||||
holder = new PiSprite();
|
||||
holder.mouseChildren = holder.mouseEnabled = false;
|
||||
holder.addChild(mc_note);
|
||||
BattleGround.getIns().container.addChild(holder);
|
||||
updateView();
|
||||
}
|
||||
|
||||
public function get viewY() : Number
|
||||
{
|
||||
return y - 60;
|
||||
}
|
||||
|
||||
public function step() : void
|
||||
{
|
||||
if(over || paused || finished)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var dt:int = Math.min(100,EnterFrameDriver.frameSpaceTime);
|
||||
age += dt;
|
||||
var move:Number = Math.min(leftDis,400 * dt / 1000);
|
||||
x += dir * move;
|
||||
leftDis -= move;
|
||||
if(leftDis <= 0)
|
||||
{
|
||||
finished = true;
|
||||
}
|
||||
updateView();
|
||||
}
|
||||
|
||||
private function updateView() : void
|
||||
{
|
||||
if(holder == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
holder.x = x;
|
||||
holder.y = y;
|
||||
holder.alpha = Math.min(1,age / 300);
|
||||
}
|
||||
|
||||
public function vanish() : void
|
||||
{
|
||||
if(over)
|
||||
{
|
||||
return;
|
||||
}
|
||||
over = true;
|
||||
if(holder != null)
|
||||
{
|
||||
TweenMax.to(holder,0.2,{
|
||||
"alpha":0,
|
||||
"scaleX":1.5,
|
||||
"scaleY":1.5,
|
||||
"onComplete":dispose
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function pause() : void
|
||||
{
|
||||
if(paused || over)
|
||||
{
|
||||
return;
|
||||
}
|
||||
paused = true;
|
||||
if(mc_note != null)
|
||||
{
|
||||
mc_note.stop();
|
||||
}
|
||||
}
|
||||
|
||||
public function resume() : void
|
||||
{
|
||||
if(!paused || over)
|
||||
{
|
||||
return;
|
||||
}
|
||||
paused = false;
|
||||
if(mc_note != null)
|
||||
{
|
||||
mc_note.play();
|
||||
}
|
||||
}
|
||||
|
||||
public function dispose() : void
|
||||
{
|
||||
over = true;
|
||||
if(holder != null)
|
||||
{
|
||||
TweenMax.killTweensOf(holder);
|
||||
holder.dispose();
|
||||
holder = null;
|
||||
}
|
||||
if(mc_note != null)
|
||||
{
|
||||
mc_note.dispose();
|
||||
mc_note = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package net.pixvi.myr.view.skillobj
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Linear;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.display.PiSprite;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class SandStrom extends PiSprite
|
||||
{
|
||||
|
||||
public var bm:BitMovieClip;
|
||||
|
||||
public var t:TweenMax;
|
||||
|
||||
public function SandStrom()
|
||||
{
|
||||
super();
|
||||
bm = FF.getBMC("mov.Skill169sand" + Random.integer());
|
||||
addChild(bm);
|
||||
bm.alpha = 0;
|
||||
bm.x = -100;
|
||||
bm.setScale(1.3);
|
||||
t = TweenMax.to(bm,2,{
|
||||
"x":Random.integer(500,700),
|
||||
"ease":Linear.easeIn,
|
||||
"onComplete":over
|
||||
});
|
||||
TweenMax.to(bm,1,{
|
||||
"alpha":1,
|
||||
"yoyo":true,
|
||||
"repeat":1,
|
||||
"ease":Linear.easeIn
|
||||
});
|
||||
}
|
||||
|
||||
public function over() : void
|
||||
{
|
||||
t.kill();
|
||||
bm.dispose();
|
||||
this.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package net.pixvi.myr.view.skillobj
|
||||
{
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.display.PiSprite;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
import net.pixvi.pfw.utils.Director;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class SkillIce extends PiSprite
|
||||
{
|
||||
|
||||
public var mc_ice:BitMovieClip;
|
||||
|
||||
public function SkillIce(delayTime:int)
|
||||
{
|
||||
super();
|
||||
mc_ice = FF.getBMC("mon.skill107Start",30);
|
||||
mc_ice.stopFrame = mc_ice.totalFrames;
|
||||
mc_ice.scaleX *= Random.direction() * Random.number(0.8,1.1);
|
||||
mc_ice.scaleY *= Random.number(0.8,1.1);
|
||||
addChild(mc_ice);
|
||||
Caller.delayCall(iceEnd,delayTime);
|
||||
}
|
||||
|
||||
public function iceEnd() : void
|
||||
{
|
||||
mc_ice.dispose();
|
||||
var bmc:BitMovieClip = FF.getBMC("mon.skill107End",30);
|
||||
Director.playOnce(bmc,bmc.dispose);
|
||||
addChild(bmc);
|
||||
SoundCenter.getIns().play(GameSound.soundName("glass_break"));
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
Caller.stopCall(iceEnd);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package net.pixvi.myr.view.skillobj
|
||||
{
|
||||
import flash.geom.Point;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.display.PiSprite;
|
||||
import net.pixvi.pfw.utils.Angler;
|
||||
|
||||
public class SnakeSword extends PiSprite
|
||||
{
|
||||
|
||||
public var mc_sword:BitMovieClip;
|
||||
|
||||
public var over:Boolean = false;
|
||||
|
||||
public var spd:Number = 20;
|
||||
|
||||
public var totalLen:int = 0;
|
||||
|
||||
public function SnakeSword(rotation:int, addFix:String = "")
|
||||
{
|
||||
super();
|
||||
mc_sword = FF.getBMC("mov.skill237knife1" + addFix);
|
||||
mc_sword.rotation = rotation;
|
||||
addChild(mc_sword);
|
||||
}
|
||||
|
||||
public function step() : void
|
||||
{
|
||||
var np:Point = Angler.getPointByRotation(this.x,this.y,mc_sword.rotation,spd,1);
|
||||
this.x = np.x;
|
||||
this.y = np.y;
|
||||
totalLen += spd;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package net.pixvi.myr.view.skillobj
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Linear;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.display.PiSprite;
|
||||
|
||||
public class SwimShark extends PiSprite
|
||||
{
|
||||
|
||||
public var mc_shark:BitMovieClip;
|
||||
|
||||
public var t:TweenMax;
|
||||
|
||||
public var swimTime:Number = 0;
|
||||
|
||||
public function SwimShark(type:String = "a", swimTime:Number = 4)
|
||||
{
|
||||
super();
|
||||
if(type == "a")
|
||||
{
|
||||
mc_shark = FF.getBMC("mov.skill211",12);
|
||||
mc_shark.setScale(0.7);
|
||||
}
|
||||
this.swimTime = swimTime;
|
||||
addChild(mc_shark);
|
||||
}
|
||||
|
||||
public function start(targetX:Number) : void
|
||||
{
|
||||
if(targetX < this.x)
|
||||
{
|
||||
mc_shark.scaleX = -1;
|
||||
}
|
||||
this.setScale(0.1);
|
||||
TweenMax.to(this,0.3,{
|
||||
"scaleX":1,
|
||||
"scaleY":1
|
||||
});
|
||||
t = TweenMax.to(this,this.swimTime,{
|
||||
"x":targetX,
|
||||
"onComplete":onComplete,
|
||||
"ease":Linear.easeIn
|
||||
});
|
||||
}
|
||||
|
||||
public function onComplete() : void
|
||||
{
|
||||
dispatchEvent(new Event("complete"));
|
||||
TweenMax.to(this,1,{
|
||||
"alpha":0,
|
||||
"onComplete":this.dispose
|
||||
});
|
||||
}
|
||||
|
||||
public function pause() : void
|
||||
{
|
||||
t.pause();
|
||||
}
|
||||
|
||||
public function resume() : void
|
||||
{
|
||||
t.resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
package net.pixvi.myr.view.skillobj
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.battle.BattleGround;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class VoidRift
|
||||
{
|
||||
|
||||
private static const FADE_IN:int = 200;
|
||||
|
||||
private static const FADE_OUT:int = 400;
|
||||
|
||||
private static const KILL_FADE:Number = 0.3;
|
||||
|
||||
private static const SCALE:Number = 1.2;
|
||||
|
||||
public var x:Number;
|
||||
|
||||
public var y:Number;
|
||||
|
||||
public var atkAdd:Number;
|
||||
|
||||
public var mc_rift:BitMovieClip;
|
||||
|
||||
public var over:Boolean = false;
|
||||
|
||||
private var hitCd:Cooldowner;
|
||||
|
||||
private var fadeInCd:Cooldowner;
|
||||
|
||||
private var fadeOutCd:Cooldowner;
|
||||
|
||||
private var leftHit:int;
|
||||
|
||||
private var fading:Boolean = false;
|
||||
|
||||
private var paused:Boolean = false;
|
||||
|
||||
private var onHit:Function;
|
||||
|
||||
public function VoidRift(px:Number, py:Number, atkAdd:Number, interval:int, hitNum:int, onHit:Function)
|
||||
{
|
||||
super();
|
||||
this.x = px;
|
||||
this.y = py;
|
||||
this.atkAdd = atkAdd;
|
||||
this.leftHit = hitNum;
|
||||
this.onHit = onHit;
|
||||
mc_rift = FF.getBMC("mov.skill264spacehit",24);
|
||||
mc_rift.x = px;
|
||||
mc_rift.y = py;
|
||||
mc_rift.scaleX = mc_rift.scaleY = 1.2;
|
||||
mc_rift.rotation = Random.rotation();
|
||||
mc_rift.alpha = 0;
|
||||
mc_rift.mouseChildren = mc_rift.mouseEnabled = false;
|
||||
BattleGround.getIns().containerTop.addChild(mc_rift);
|
||||
fadeInCd = new Cooldowner(200);
|
||||
fadeInCd.activity();
|
||||
fadeOutCd = new Cooldowner(400);
|
||||
hitCd = new Cooldowner(interval);
|
||||
}
|
||||
|
||||
public function step() : void
|
||||
{
|
||||
if(over || paused)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(!fading)
|
||||
{
|
||||
mc_rift.alpha = fadeInCd.passTime / 200;
|
||||
if(hitCd.cooldown)
|
||||
{
|
||||
if(leftHit <= 0)
|
||||
{
|
||||
fading = true;
|
||||
fadeOutCd.activity();
|
||||
return;
|
||||
}
|
||||
hitCd.activity();
|
||||
leftHit--;
|
||||
if(onHit != null)
|
||||
{
|
||||
onHit(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mc_rift.alpha = 1 - fadeOutCd.passTime / 400;
|
||||
if(fadeOutCd.cooldown)
|
||||
{
|
||||
dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function pause() : void
|
||||
{
|
||||
if(paused || over)
|
||||
{
|
||||
return;
|
||||
}
|
||||
paused = true;
|
||||
hitCd.pause();
|
||||
fadeInCd.pause();
|
||||
fadeOutCd.pause();
|
||||
mc_rift.stop();
|
||||
}
|
||||
|
||||
public function resume() : void
|
||||
{
|
||||
if(!paused || over)
|
||||
{
|
||||
return;
|
||||
}
|
||||
paused = false;
|
||||
hitCd.resume();
|
||||
fadeInCd.resume();
|
||||
fadeOutCd.resume();
|
||||
mc_rift.play();
|
||||
}
|
||||
|
||||
public function kill() : void
|
||||
{
|
||||
if(over)
|
||||
{
|
||||
return;
|
||||
}
|
||||
over = true;
|
||||
onHit = null;
|
||||
TweenMax.to(mc_rift,0.3,{
|
||||
"alpha":0,
|
||||
"onComplete":disposeMovie
|
||||
});
|
||||
}
|
||||
|
||||
public function dispose() : void
|
||||
{
|
||||
over = true;
|
||||
onHit = null;
|
||||
disposeMovie();
|
||||
}
|
||||
|
||||
private function disposeMovie() : void
|
||||
{
|
||||
if(mc_rift != null)
|
||||
{
|
||||
TweenMax.killTweensOf(mc_rift);
|
||||
mc_rift.dispose();
|
||||
mc_rift = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user