Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,323 @@
|
||||
package net.pixvi.myr.view.move
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Bounce;
|
||||
import com.greensock.easing.Cubic;
|
||||
import com.greensock.easing.Sine;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.effect.effects.ShakeEffect;
|
||||
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.interfaces.IDispose;
|
||||
|
||||
public class BaseMove implements IDispose
|
||||
{
|
||||
|
||||
public var target:Sprite;
|
||||
|
||||
public var scale:Number;
|
||||
|
||||
public var t:TweenMax;
|
||||
|
||||
public var tmove:TweenMax;
|
||||
|
||||
public var tshadow:TweenMax;
|
||||
|
||||
public var whenStopCompleteFunction:Function;
|
||||
|
||||
public var lockPause:Boolean = false;
|
||||
|
||||
public var high:Number = 0;
|
||||
|
||||
public var readyActioning:Boolean = true;
|
||||
|
||||
private var oscale:Number = 1;
|
||||
|
||||
public var mon:BattleMon;
|
||||
|
||||
private var flyFromShake:Boolean = false;
|
||||
|
||||
public function BaseMove()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(target:Sprite, scale:Number) : void
|
||||
{
|
||||
this.target = target;
|
||||
this.scale = scale;
|
||||
}
|
||||
|
||||
public function idle() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function start() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function getTime(time:Number) : Number
|
||||
{
|
||||
if(this.mon == null || this.mon.buff.get_movSpd == 0)
|
||||
{
|
||||
return time;
|
||||
}
|
||||
return time * 2;
|
||||
}
|
||||
|
||||
public function startWithAction(action:String = "none") : void
|
||||
{
|
||||
setHigh();
|
||||
switch(action)
|
||||
{
|
||||
case "flyDown":
|
||||
target.y = -500;
|
||||
readyActioning = true;
|
||||
t = TweenMax.to(target,0.5,{
|
||||
"overwrite":"NONE",
|
||||
"y":-high,
|
||||
"onComplete":actionToStart,
|
||||
"ease":Sine.easeOut
|
||||
});
|
||||
break;
|
||||
case "flyUp":
|
||||
target.y = 0;
|
||||
readyActioning = true;
|
||||
t = TweenMax.to(target,0.3,{
|
||||
"overwrite":"NONE",
|
||||
"y":-high,
|
||||
"onComplete":actionToStart,
|
||||
"ease":Cubic.easeInOut
|
||||
});
|
||||
break;
|
||||
case "jumpOut":
|
||||
target.y = 0;
|
||||
oscale = target.scaleY;
|
||||
readyActioning = true;
|
||||
target.scaleY = oscale + 0.1;
|
||||
target.alpha = 0.3;
|
||||
t = TweenMax.to(target,0.2,{
|
||||
"overwrite":"NONE",
|
||||
"alpha":1,
|
||||
"y":-50,
|
||||
"scaleY":oscale - 0.1,
|
||||
"onComplete":jumpOutStep2,
|
||||
"ease":Sine.easeOut
|
||||
});
|
||||
break;
|
||||
case "jumpOut2":
|
||||
target.y = 0;
|
||||
oscale = target.scaleY;
|
||||
readyActioning = true;
|
||||
target.scaleY = oscale + 0.1;
|
||||
target.alpha = 0.3;
|
||||
t = TweenMax.to(target,0.2,{
|
||||
"overwrite":"NONE",
|
||||
"alpha":1,
|
||||
"y":-80,
|
||||
"scaleY":oscale - 0.1,
|
||||
"onComplete":jumpOutStep2,
|
||||
"ease":Sine.easeOut
|
||||
});
|
||||
break;
|
||||
case "jumpOut3":
|
||||
target.y = 0;
|
||||
oscale = target.scaleY;
|
||||
readyActioning = true;
|
||||
target.scaleY = oscale + 0.1;
|
||||
target.alpha = 0.3;
|
||||
t = TweenMax.to(target,0.2,{
|
||||
"overwrite":"NONE",
|
||||
"alpha":1,
|
||||
"y":-110,
|
||||
"scaleY":oscale - 0.1,
|
||||
"onComplete":jumpOutStep2,
|
||||
"ease":Sine.easeOut
|
||||
});
|
||||
break;
|
||||
case "drop":
|
||||
target.y = -500;
|
||||
readyActioning = true;
|
||||
t = TweenMax.fromTo(target,1,{"scaleY":target.scaleY + 0.3},{
|
||||
"overwrite":"NONE",
|
||||
"y":0,
|
||||
"scaleY":target.scaleY,
|
||||
"onComplete":dropStep2,
|
||||
"ease":Sine.easeIn
|
||||
});
|
||||
break;
|
||||
default:
|
||||
case "none":
|
||||
readyActioning = false;
|
||||
break;
|
||||
case "flyFromR":
|
||||
readyActioning = true;
|
||||
target.y = -300;
|
||||
target.parent["shadow"].x = target.x = 240;
|
||||
t = TweenMax.to(target,1.5,{"x":0});
|
||||
tshadow = TweenMax.to(target.parent["shadow"],1.5,{"x":0});
|
||||
tmove = TweenMax.to(target,1.5,{
|
||||
"y":0,
|
||||
"ease":Bounce.easeOut,
|
||||
"onUpdate":flyFromUpdate,
|
||||
"onComplete":actionToStart
|
||||
});
|
||||
break;
|
||||
case "flyFromL":
|
||||
readyActioning = true;
|
||||
target.y = -300;
|
||||
target.parent["shadow"].x = target.x = -240;
|
||||
t = TweenMax.to(target,1.5,{"x":0});
|
||||
tshadow = TweenMax.to(target.parent["shadow"],1.5,{"x":0});
|
||||
tmove = TweenMax.to(target,1.5,{
|
||||
"y":0,
|
||||
"ease":Bounce.easeOut,
|
||||
"onUpdate":flyFromUpdate,
|
||||
"onComplete":actionToStart
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private function flyFromUpdate() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(!flyFromShake && target.y > -7)
|
||||
{
|
||||
flyFromShake = true;
|
||||
if(target.scaleX > BattleMon.OSCALE * 1.2)
|
||||
{
|
||||
SoundCenter.getIns().play(GameSound.soundName("effect_fall"));
|
||||
new ShakeEffect(0,11,0.9).startEffect(BattlePanel.getIns().ground);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function dropStep2() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(target.scaleX > BattleMon.OSCALE * 1.2)
|
||||
{
|
||||
SoundCenter.getIns().play(GameSound.soundName("effect_fall"));
|
||||
new ShakeEffect(0,6).startEffect(BattlePanel.getIns().ground);
|
||||
}
|
||||
actionToStart();
|
||||
}
|
||||
|
||||
private function jumpOutStep2() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,0.2,{
|
||||
"overwrite":"NONE",
|
||||
"y":0,
|
||||
"scaleY":oscale,
|
||||
"onComplete":actionToStart,
|
||||
"ease":Sine.easeIn
|
||||
});
|
||||
}
|
||||
|
||||
public function actionToStart() : void
|
||||
{
|
||||
readyActioning = false;
|
||||
start();
|
||||
}
|
||||
|
||||
public function stop() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function stopWithFunction(onStop:Function) : void
|
||||
{
|
||||
whenStopCompleteFunction = onStop;
|
||||
stop();
|
||||
}
|
||||
|
||||
public function stopComplete() : void
|
||||
{
|
||||
if(whenStopCompleteFunction != null)
|
||||
{
|
||||
whenStopCompleteFunction();
|
||||
whenStopCompleteFunction = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function pause(lock:Boolean = false) : void
|
||||
{
|
||||
if(!lockPause)
|
||||
{
|
||||
this.lockPause = lock;
|
||||
}
|
||||
if(t != null)
|
||||
{
|
||||
t.pause();
|
||||
}
|
||||
if(tmove != null)
|
||||
{
|
||||
tmove.pause();
|
||||
}
|
||||
if(tshadow != null)
|
||||
{
|
||||
tshadow.pause();
|
||||
}
|
||||
}
|
||||
|
||||
public function resume(lock:Boolean = false) : void
|
||||
{
|
||||
if(lockPause && !lock)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(t != null && t.paused)
|
||||
{
|
||||
t.resume();
|
||||
}
|
||||
lockPause = false;
|
||||
if(tmove != null && tmove.paused())
|
||||
{
|
||||
tmove.resume();
|
||||
}
|
||||
if(tshadow != null && tshadow.paused())
|
||||
{
|
||||
tshadow.resume();
|
||||
}
|
||||
}
|
||||
|
||||
public function dispose() : void
|
||||
{
|
||||
if(t != null)
|
||||
{
|
||||
t.kill();
|
||||
}
|
||||
if(tmove != null)
|
||||
{
|
||||
tmove.kill();
|
||||
}
|
||||
if(tshadow != null)
|
||||
{
|
||||
tshadow.kill();
|
||||
}
|
||||
whenStopCompleteFunction = null;
|
||||
target = null;
|
||||
}
|
||||
|
||||
public function setHigh() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function isStopCompletely() : Boolean
|
||||
{
|
||||
return t == null || t.progress() == 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package net.pixvi.myr.view.move
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Quint;
|
||||
import com.greensock.easing.Sine;
|
||||
|
||||
public class MoveCrawlX extends BaseMove
|
||||
{
|
||||
|
||||
public function MoveCrawlX()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
step1();
|
||||
}
|
||||
|
||||
public function step1() : void
|
||||
{
|
||||
if(target != null)
|
||||
{
|
||||
t = TweenMax.to(target,getTime(0.3),{
|
||||
"scaleY":scale - 0.02,
|
||||
"scaleX":scale + 0.04,
|
||||
"x":target.getChildAt(0).scaleX * 8,
|
||||
"onComplete":step2,
|
||||
"ease":Sine.easeInOut
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function step2() : void
|
||||
{
|
||||
if(target != null)
|
||||
{
|
||||
t = TweenMax.to(target,getTime(0.3),{
|
||||
"scaleY":scale + 0.02,
|
||||
"scaleX":scale - 0.04,
|
||||
"x":target.getChildAt(0).scaleX * -8,
|
||||
"onComplete":step1,
|
||||
"ease":Sine.easeInOut
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
override public function stop() : void
|
||||
{
|
||||
if(t != null)
|
||||
{
|
||||
t.kill();
|
||||
}
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,0.1,{
|
||||
"scaleY":scale,
|
||||
"scaleX":scale,
|
||||
"x":0,
|
||||
"ease":Quint.easeInOut,
|
||||
"onComplete":stopComplete
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package net.pixvi.myr.view.move
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Quint;
|
||||
import com.greensock.easing.Sine;
|
||||
|
||||
public class MoveCrawlY extends BaseMove
|
||||
{
|
||||
|
||||
public function MoveCrawlY()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
step1();
|
||||
}
|
||||
|
||||
public function step1() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,getTime(0.3),{
|
||||
"scaleY":scale - 0.03,
|
||||
"y":0,
|
||||
"scaleX":scale + 0.05,
|
||||
"onComplete":step2,
|
||||
"ease":Sine.easeInOut
|
||||
});
|
||||
}
|
||||
|
||||
public function step2() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
if(t != null)
|
||||
{
|
||||
t.kill();
|
||||
}
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,getTime(0.3),{
|
||||
"scaleY":scale + 0.03,
|
||||
"y":-5,
|
||||
"scaleX":scale - 0.05,
|
||||
"onComplete":step1,
|
||||
"ease":Sine.easeInOut
|
||||
});
|
||||
}
|
||||
|
||||
override public function stop() : void
|
||||
{
|
||||
if(t != null)
|
||||
{
|
||||
t.kill();
|
||||
}
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,0.1,{
|
||||
"scaleY":scale,
|
||||
"y":0,
|
||||
"scaleX":scale,
|
||||
"ease":Quint.easeInOut,
|
||||
"onComplete":stopComplete
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package net.pixvi.myr.view.move
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Sine;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class MoveFloat extends BaseMove
|
||||
{
|
||||
|
||||
public function MoveFloat()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
step0();
|
||||
}
|
||||
|
||||
override public function setHigh() : void
|
||||
{
|
||||
high = Random.integer(50,100);
|
||||
}
|
||||
|
||||
public function step0() : void
|
||||
{
|
||||
if(t != null)
|
||||
{
|
||||
t.kill();
|
||||
}
|
||||
step2();
|
||||
}
|
||||
|
||||
public function step1() : void
|
||||
{
|
||||
if(target != null)
|
||||
{
|
||||
t = TweenMax.to(target,getTime(0.4),{
|
||||
"overwrite":"NONE",
|
||||
"y":-high,
|
||||
"x":Random.integer(-10,10),
|
||||
"onComplete":step2,
|
||||
"ease":Sine.easeInOut
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function step2() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,getTime(0.4),{
|
||||
"overwrite":"NONE",
|
||||
"y":-high - 30,
|
||||
"x":Random.integer(-10,10),
|
||||
"onComplete":step1,
|
||||
"ease":Sine.easeInOut
|
||||
});
|
||||
}
|
||||
|
||||
override public function isStopCompletely() : Boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
override public function stop() : void
|
||||
{
|
||||
stopComplete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
package net.pixvi.myr.view.move
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Sine;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class MoveFly extends BaseMove
|
||||
{
|
||||
|
||||
public function MoveFly()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
if(target.y > 50)
|
||||
{
|
||||
step1();
|
||||
}
|
||||
else
|
||||
{
|
||||
step0();
|
||||
}
|
||||
}
|
||||
|
||||
override public function setHigh() : void
|
||||
{
|
||||
high = Random.integer(55,75);
|
||||
}
|
||||
|
||||
public function step0() : void
|
||||
{
|
||||
if(t != null)
|
||||
{
|
||||
t.kill();
|
||||
}
|
||||
step1();
|
||||
}
|
||||
|
||||
public function step1() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,getTime(0.2),{
|
||||
"overwrite":"NONE",
|
||||
"y":-high,
|
||||
"onComplete":step2,
|
||||
"ease":Sine.easeInOut
|
||||
});
|
||||
}
|
||||
|
||||
public function step2() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,getTime(0.2),{
|
||||
"overwrite":"NONE",
|
||||
"y":-high - 22,
|
||||
"onComplete":step1,
|
||||
"ease":Sine.easeInOut
|
||||
});
|
||||
}
|
||||
|
||||
override public function isStopCompletely() : Boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
override public function stop() : void
|
||||
{
|
||||
stopComplete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package net.pixvi.myr.view.move
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Sine;
|
||||
import net.pixvi.myr.view.mon.GroundMon;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class MoveFly2 extends BaseMove
|
||||
{
|
||||
|
||||
public function MoveFly2()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
if(target.y > 50)
|
||||
{
|
||||
step1();
|
||||
}
|
||||
else
|
||||
{
|
||||
step0();
|
||||
}
|
||||
}
|
||||
|
||||
override public function setHigh() : void
|
||||
{
|
||||
if(target.parent is GroundMon)
|
||||
{
|
||||
high = Random.integer(100,150);
|
||||
}
|
||||
else
|
||||
{
|
||||
high = Random.integer(50,75);
|
||||
}
|
||||
}
|
||||
|
||||
public function step0() : void
|
||||
{
|
||||
if(t != null)
|
||||
{
|
||||
t.kill();
|
||||
}
|
||||
step1();
|
||||
}
|
||||
|
||||
public function step1() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,getTime(0.1),{
|
||||
"overwrite":"NONE",
|
||||
"y":-high,
|
||||
"onComplete":step2,
|
||||
"ease":Sine.easeInOut
|
||||
});
|
||||
}
|
||||
|
||||
public function step2() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,getTime(0.1),{
|
||||
"overwrite":"NONE",
|
||||
"y":-high - 7,
|
||||
"onComplete":step1,
|
||||
"ease":Sine.easeInOut
|
||||
});
|
||||
}
|
||||
|
||||
override public function isStopCompletely() : Boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
override public function stop() : void
|
||||
{
|
||||
stopComplete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
package net.pixvi.myr.view.move
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Cubic;
|
||||
|
||||
public class MoveJump extends BaseMove
|
||||
{
|
||||
|
||||
public var onstop:Boolean = true;
|
||||
|
||||
public var fall:Boolean = false;
|
||||
|
||||
public function MoveJump()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
onstop = false;
|
||||
if(t != null)
|
||||
{
|
||||
t.kill();
|
||||
}
|
||||
step1();
|
||||
}
|
||||
|
||||
public function step1() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
fall = false;
|
||||
t = TweenMax.to(target,getTime(0.2),{
|
||||
"y":-50,
|
||||
"scaleY":scale + 0.05,
|
||||
"scaleX":scale - 0.05,
|
||||
"onComplete":step2,
|
||||
"ease":Cubic.easeOut
|
||||
});
|
||||
}
|
||||
|
||||
public function step2() : void
|
||||
{
|
||||
if(target != null)
|
||||
{
|
||||
fall = true;
|
||||
if(!onstop)
|
||||
{
|
||||
t = TweenMax.to(target,getTime(0.2),{
|
||||
"y":0,
|
||||
"scaleY":scale - 0.09,
|
||||
"scaleX":scale + 0.09,
|
||||
"onComplete":step1,
|
||||
"ease":Cubic.easeIn
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
t = TweenMax.to(target,getTime(0.2),{
|
||||
"y":0,
|
||||
"scaleY":scale,
|
||||
"scaleX":scale,
|
||||
"ease":Cubic.easeIn,
|
||||
"onComplete":stopCompleteFinal
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function stop() : void
|
||||
{
|
||||
onstop = true;
|
||||
if(t == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(t != null && t.vars.onComplete == step1)
|
||||
{
|
||||
t.vars = {"onComplete":stopComplete2};
|
||||
}
|
||||
}
|
||||
|
||||
public function stopComplete2() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,0.05,{
|
||||
"y":0,
|
||||
"scaleY":scale,
|
||||
"scaleX":scale,
|
||||
"ease":Cubic.easeIn,
|
||||
"onComplete":stopCompleteFinal
|
||||
});
|
||||
}
|
||||
|
||||
public function stopCompleteFinal() : void
|
||||
{
|
||||
onstop = false;
|
||||
if(stopComplete != null)
|
||||
{
|
||||
stopComplete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
package net.pixvi.myr.view.move
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Cubic;
|
||||
|
||||
public class MoveJump2 extends BaseMove
|
||||
{
|
||||
|
||||
public var onstop:Boolean = true;
|
||||
|
||||
public function MoveJump2()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
onstop = false;
|
||||
step1();
|
||||
}
|
||||
|
||||
public function step1() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,getTime(0.15),{
|
||||
"y":-20,
|
||||
"scaleY":scale + 0.03,
|
||||
"scaleX":scale - 0.03,
|
||||
"onComplete":step2,
|
||||
"ease":Cubic.easeOut
|
||||
});
|
||||
}
|
||||
|
||||
public function step2() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(!onstop)
|
||||
{
|
||||
t = TweenMax.to(target,getTime(0.15),{
|
||||
"y":0,
|
||||
"scaleY":scale - 0.03,
|
||||
"scaleX":scale + 0.03,
|
||||
"onComplete":step1,
|
||||
"ease":Cubic.easeIn
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
t = TweenMax.to(target,getTime(0.15),{
|
||||
"y":0,
|
||||
"scaleY":scale,
|
||||
"scaleX":scale,
|
||||
"ease":Cubic.easeIn,
|
||||
"onComplete":stopCompleteFinal
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
override public function stop() : void
|
||||
{
|
||||
onstop = true;
|
||||
if(t == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(t.vars.onComplete == step1)
|
||||
{
|
||||
t.vars = {"onComplete":stopComplete2};
|
||||
}
|
||||
}
|
||||
|
||||
public function stopComplete2() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,0.04,{
|
||||
"y":0,
|
||||
"scaleY":scale,
|
||||
"scaleX":scale,
|
||||
"ease":Cubic.easeIn,
|
||||
"onComplete":stopCompleteFinal
|
||||
});
|
||||
}
|
||||
|
||||
public function stopCompleteFinal() : void
|
||||
{
|
||||
onstop = false;
|
||||
if(stopComplete != null)
|
||||
{
|
||||
stopComplete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
package net.pixvi.myr.view.move
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Cubic;
|
||||
|
||||
public class MoveJump3 extends BaseMove
|
||||
{
|
||||
|
||||
public var onstop:Boolean = true;
|
||||
|
||||
public var fall:Boolean = false;
|
||||
|
||||
public function MoveJump3()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
onstop = false;
|
||||
step1();
|
||||
}
|
||||
|
||||
public function step1() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
fall = false;
|
||||
t = TweenMax.to(target,getTime(0.3),{
|
||||
"y":-35,
|
||||
"scaleY":scale + 0.05,
|
||||
"scaleX":scale - 0.05,
|
||||
"onComplete":step2,
|
||||
"ease":Cubic.easeOut
|
||||
});
|
||||
}
|
||||
|
||||
public function step2() : void
|
||||
{
|
||||
if(target != null)
|
||||
{
|
||||
fall = true;
|
||||
if(!onstop)
|
||||
{
|
||||
t = TweenMax.to(target,getTime(0.3),{
|
||||
"y":0,
|
||||
"scaleY":scale - 0.09,
|
||||
"scaleX":scale + 0.09,
|
||||
"onComplete":step1,
|
||||
"ease":Cubic.easeIn
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
t = TweenMax.to(target,getTime(0.3),{
|
||||
"y":0,
|
||||
"scaleY":scale,
|
||||
"scaleX":scale,
|
||||
"ease":Cubic.easeIn,
|
||||
"onComplete":stopComplete
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function stop() : void
|
||||
{
|
||||
onstop = true;
|
||||
if(t != null && t.vars.onComplete == step1)
|
||||
{
|
||||
t.vars = {"onComplete":stopComplete2};
|
||||
}
|
||||
}
|
||||
|
||||
public function stopComplete2() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,0.05,{
|
||||
"y":0,
|
||||
"scaleY":scale,
|
||||
"scaleX":scale,
|
||||
"ease":Cubic.easeIn,
|
||||
"onComplete":stopComplete
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package net.pixvi.myr.view.move
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Quint;
|
||||
import com.greensock.easing.Sine;
|
||||
|
||||
public class MoveWalk extends BaseMove
|
||||
{
|
||||
|
||||
public function MoveWalk()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
step1();
|
||||
}
|
||||
|
||||
public function step1() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,0.2,{
|
||||
"rotation":1,
|
||||
"onComplete":step2,
|
||||
"ease":Sine.easeInOut
|
||||
});
|
||||
}
|
||||
|
||||
public function step2() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,0.2,{
|
||||
"rotation":-1,
|
||||
"onComplete":step1,
|
||||
"ease":Sine.easeInOut
|
||||
});
|
||||
}
|
||||
|
||||
override public function stop() : void
|
||||
{
|
||||
if(t != null)
|
||||
{
|
||||
t.kill();
|
||||
}
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,0.1,{
|
||||
"rotation":0,
|
||||
"x":0,
|
||||
"ease":Quint.easeInOut,
|
||||
"onComplete":stopComplete
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package net.pixvi.myr.view.move
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Quint;
|
||||
import com.greensock.easing.Sine;
|
||||
|
||||
public class MoveWalk2 extends BaseMove
|
||||
{
|
||||
|
||||
public function MoveWalk2()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
step1();
|
||||
}
|
||||
|
||||
public function step1() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,0.2,{
|
||||
"x":-7,
|
||||
"onComplete":step2,
|
||||
"ease":Sine.easeInOut
|
||||
});
|
||||
}
|
||||
|
||||
public function step2() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,0.2,{
|
||||
"x":7,
|
||||
"onComplete":step1,
|
||||
"ease":Sine.easeInOut
|
||||
});
|
||||
}
|
||||
|
||||
override public function stop() : void
|
||||
{
|
||||
if(t != null)
|
||||
{
|
||||
t.kill();
|
||||
}
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,0.1,{
|
||||
"x":0,
|
||||
"ease":Quint.easeInOut,
|
||||
"onComplete":stopComplete
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
package net.pixvi.myr.view.move
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Quint;
|
||||
import com.greensock.easing.Sine;
|
||||
|
||||
public class MoveWalk3 extends BaseMove
|
||||
{
|
||||
|
||||
public function MoveWalk3()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
step1();
|
||||
}
|
||||
|
||||
public function step1() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,0.2,{
|
||||
"rotation":10,
|
||||
"x":-4,
|
||||
"onComplete":step2,
|
||||
"ease":Sine.easeInOut
|
||||
});
|
||||
}
|
||||
|
||||
public function step2() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,0.2,{
|
||||
"rotation":-10,
|
||||
"x":4,
|
||||
"onComplete":step1,
|
||||
"ease":Sine.easeInOut
|
||||
});
|
||||
}
|
||||
|
||||
override public function stop() : void
|
||||
{
|
||||
if(t != null)
|
||||
{
|
||||
t.kill();
|
||||
}
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
t = TweenMax.to(target,0.1,{
|
||||
"rotation":0,
|
||||
"x":0,
|
||||
"ease":Quint.easeInOut,
|
||||
"onComplete":stopComplete
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
package net.pixvi.myr.view.move
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Quint;
|
||||
import com.greensock.easing.Sine;
|
||||
|
||||
public class MoveWalk4 extends BaseMove
|
||||
{
|
||||
|
||||
public function MoveWalk4()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
step1();
|
||||
}
|
||||
|
||||
public function step1() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
TweenMax.to(target,0.1,{"rotation":target.getChildAt(0).scaleX * 10});
|
||||
t = TweenMax.to(target,0.15,{
|
||||
"y":-39,
|
||||
"onComplete":step2,
|
||||
"ease":Sine.easeInOut
|
||||
});
|
||||
}
|
||||
|
||||
public function step2() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
TweenMax.to(target,0.1,{"rotation":target.getChildAt(0).scaleX * -10});
|
||||
t = TweenMax.to(target,0.15,{
|
||||
"y":0,
|
||||
"onComplete":step1,
|
||||
"ease":Sine.easeInOut
|
||||
});
|
||||
}
|
||||
|
||||
override public function stop() : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(t != null)
|
||||
{
|
||||
t.kill();
|
||||
}
|
||||
if(target != null)
|
||||
{
|
||||
t = TweenMax.to(target,0.1,{
|
||||
"rotation":0,
|
||||
"y":0,
|
||||
"ease":Quint.easeInOut,
|
||||
"onComplete":stopComplete
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package net.pixvi.myr.view.move.type
|
||||
{
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.view.move.BaseMove;
|
||||
import net.pixvi.myr.view.move.MoveCrawlX;
|
||||
import net.pixvi.myr.view.move.MoveCrawlY;
|
||||
import net.pixvi.myr.view.move.MoveFloat;
|
||||
import net.pixvi.myr.view.move.MoveFly;
|
||||
import net.pixvi.myr.view.move.MoveFly2;
|
||||
import net.pixvi.myr.view.move.MoveJump;
|
||||
import net.pixvi.myr.view.move.MoveJump2;
|
||||
import net.pixvi.myr.view.move.MoveJump3;
|
||||
import net.pixvi.myr.view.move.MoveWalk;
|
||||
import net.pixvi.myr.view.move.MoveWalk2;
|
||||
import net.pixvi.myr.view.move.MoveWalk3;
|
||||
import net.pixvi.myr.view.move.MoveWalk4;
|
||||
|
||||
public class MoveType
|
||||
{
|
||||
|
||||
public function MoveType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getMove(moveType:String) : BaseMove
|
||||
{
|
||||
switch(int(moveType))
|
||||
{
|
||||
case 0:
|
||||
return new BaseMove();
|
||||
case 1:
|
||||
return new MoveWalk();
|
||||
case 2:
|
||||
return new MoveJump();
|
||||
case 3:
|
||||
return new MoveJump2();
|
||||
case 4:
|
||||
return new MoveCrawlX();
|
||||
case 5:
|
||||
return new MoveCrawlY();
|
||||
case 6:
|
||||
return new MoveFloat();
|
||||
case 7:
|
||||
return new MoveFly();
|
||||
case 8:
|
||||
return new MoveFly2();
|
||||
case 9:
|
||||
return new MoveWalk2();
|
||||
case 10:
|
||||
return new MoveWalk3();
|
||||
case 11:
|
||||
return new MoveWalk4();
|
||||
case 12:
|
||||
return new MoveJump3();
|
||||
default:
|
||||
trace("no choice");
|
||||
return new MoveWalk();
|
||||
}
|
||||
}
|
||||
|
||||
public static function isFly(type:int) : Boolean
|
||||
{
|
||||
return Table.monster_setting.move[type].isFly;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user