Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package net.pixvi.myr.battle.view
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
|
||||
public class BattleBossPointUI extends UIComponent
|
||||
{
|
||||
|
||||
public var text_bossPoint:PiBitTextField;
|
||||
|
||||
public var text_pointName:PiBitTextField;
|
||||
|
||||
public function BattleBossPointUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,103 @@
|
||||
package net.pixvi.myr.battle.view
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.Event;
|
||||
import flash.utils.Timer;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBar;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
|
||||
public class BattleMonInfoUI extends UIComponent
|
||||
{
|
||||
|
||||
public var bar_hp:PiBar;
|
||||
|
||||
public var text_level:PiBitTextField;
|
||||
|
||||
public var mc_shooter:MovieClip;
|
||||
|
||||
private var _keepShow:Boolean = false;
|
||||
|
||||
private var showTimer:Timer;
|
||||
|
||||
public var importantTarget:Boolean = false;
|
||||
|
||||
public var text_name:PiBitTextField;
|
||||
|
||||
public function BattleMonInfoUI(team:int = 1)
|
||||
{
|
||||
var skin:DisplayObject = null;
|
||||
if(team == 1)
|
||||
{
|
||||
skin = FF.getMC("ui.BattleMonInfoUIGreen");
|
||||
}
|
||||
else
|
||||
{
|
||||
skin = FF.getMC("ui.BattleMonInfoUIRed");
|
||||
}
|
||||
super(skin);
|
||||
this.setScale(0.75);
|
||||
showTimer = new Timer(1500,1);
|
||||
showTimer.addEventListener("timerComplete",timerComplete);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
text_name.scaleMode = true;
|
||||
super.onSkinComplete();
|
||||
bar_hp.buffTime = 0.15;
|
||||
}
|
||||
|
||||
public function showIcon(icon:String) : void
|
||||
{
|
||||
var bm:BitMovieClip = FF.getBMC(icon);
|
||||
bm.mouseChildren = bm.mouseEnabled = false;
|
||||
addChild(bm);
|
||||
}
|
||||
|
||||
private function timerComplete(e:Event = null) : void
|
||||
{
|
||||
if(!_keepShow)
|
||||
{
|
||||
hideHp();
|
||||
}
|
||||
}
|
||||
|
||||
public function set keepShow(show:Boolean) : void
|
||||
{
|
||||
_keepShow = show;
|
||||
if(show)
|
||||
{
|
||||
showHp();
|
||||
}
|
||||
else
|
||||
{
|
||||
hideHp();
|
||||
}
|
||||
}
|
||||
|
||||
public function showHpSomeTime() : void
|
||||
{
|
||||
showHp();
|
||||
showTimer.reset();
|
||||
showTimer.start();
|
||||
}
|
||||
|
||||
public function showHp() : void
|
||||
{
|
||||
this.visible = true;
|
||||
}
|
||||
|
||||
public function hideHp() : void
|
||||
{
|
||||
if(!importantTarget)
|
||||
{
|
||||
this.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
package net.pixvi.myr.battle.view
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.utils.Gesturer;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
import net.pixvi.pfw.display.NetBitImg;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiListItem;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class BattleMonItem extends PiListItem
|
||||
{
|
||||
|
||||
public var text_level:PiBitTextField;
|
||||
|
||||
public var img_select:Sprite;
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public var boardimg:NetBitImg;
|
||||
|
||||
public var curmon:BattleMon;
|
||||
|
||||
public var gesture:Gesturer;
|
||||
|
||||
public function BattleMonItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
img_select.visible = false;
|
||||
container_img.setSize(75,75);
|
||||
PiLightButton.btnTouchLight.setDisplay(this);
|
||||
super.onSkinComplete();
|
||||
gesture = new Gesturer(skin,true);
|
||||
gesture.dragLength = 80;
|
||||
gesture.addEventListener(Gesturer.DRAG,dragHandler);
|
||||
gesture.start();
|
||||
}
|
||||
|
||||
private function dragHandler(e:Event = null) : void
|
||||
{
|
||||
if(!BattlePanel.getIns().ground.battleIsStart || BattlePanel.getIns().ground.paused || !(_data as BattleMon).moveable || (_data as BattleMon).monVo.isObject)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(_data != null)
|
||||
{
|
||||
(_data as BattleMon).dragHandler();
|
||||
}
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
var battlemon:BattleMon = value as BattleMon;
|
||||
if(curmon == battlemon)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(curmon != null && (curmon.monVo.type != battlemon.monVo.type || curmon.monVo.mode != battlemon.monVo.mode))
|
||||
{
|
||||
if(boardimg != null)
|
||||
{
|
||||
boardimg.dispose();
|
||||
}
|
||||
}
|
||||
boardimg = new NetBitImg(ImgCenter.getBattleMonBoard(battlemon.vo.quality));
|
||||
container_img.parent.addChildAt(boardimg,container_img.parent.getChildIndex(container_img) + 1);
|
||||
curmon = battlemon;
|
||||
text_level.htmlText = Paster.font("LV:",null,20) + Paster.font(battlemon.monVo.level.toString(),null,28);
|
||||
container_img.loadNetBitImg(battlemon.vo.getImg("avatar"),true,true,0);
|
||||
this.addEventListener(MobiEvent.CLICK,clickHandler);
|
||||
}
|
||||
|
||||
public function clickHandler(e:Event = null) : void
|
||||
{
|
||||
if(!BattlePanel.getIns().ground.battleIsStart)
|
||||
{
|
||||
return;
|
||||
}
|
||||
sendSelect();
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
curmon = null;
|
||||
gesture.dispose();
|
||||
PiLightButton.btnTouchLight.removeDisplay(this);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
override public function set selected(value:Boolean) : void
|
||||
{
|
||||
img_select.visible = value;
|
||||
super.selected = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
package net.pixvi.myr.battle.view
|
||||
{
|
||||
public class BattleMonRecordVo
|
||||
{
|
||||
|
||||
public var maxDamage:Number = 0;
|
||||
|
||||
public var avgDamage:Number = 0;
|
||||
|
||||
public var totalCure:Number = 0;
|
||||
|
||||
public var mid:String;
|
||||
|
||||
public var atk:Number;
|
||||
|
||||
public var def:Number;
|
||||
|
||||
public var hp:Number;
|
||||
|
||||
public var buffAtk:Number;
|
||||
|
||||
public var buffDefDama:Number;
|
||||
|
||||
public var hpMax:Number;
|
||||
|
||||
public var dex:Number;
|
||||
|
||||
public var selfCure:Number;
|
||||
|
||||
public var atkVim:Number;
|
||||
|
||||
public var atkStun:Number;
|
||||
|
||||
public var defStun:Number;
|
||||
|
||||
public var atkPoi:Number;
|
||||
|
||||
public var atkPoiDmg:Number;
|
||||
|
||||
public var skillCooldown:Number;
|
||||
|
||||
public var sunFire:Number;
|
||||
|
||||
public var moonHeal:Number;
|
||||
|
||||
public var deadBoom:Number;
|
||||
|
||||
public var thorns:Number;
|
||||
|
||||
public var crit:Number;
|
||||
|
||||
public var totalDmg:Number = 0;
|
||||
|
||||
public var monsterVo:Object;
|
||||
|
||||
public var skillLevel1:Number;
|
||||
|
||||
public var skillLevel2:Number;
|
||||
|
||||
public function BattleMonRecordVo()
|
||||
{
|
||||
super();
|
||||
totalDmg = 0;
|
||||
}
|
||||
|
||||
public function recordDmg(dmg:int) : void
|
||||
{
|
||||
if(maxDamage < dmg)
|
||||
{
|
||||
maxDamage = dmg;
|
||||
}
|
||||
totalDmg += dmg;
|
||||
}
|
||||
|
||||
public function recordCure(cure:int) : void
|
||||
{
|
||||
totalCure += cure;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
package net.pixvi.myr.battle.view
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.common.driver.TipDriver;
|
||||
import net.pixvi.myr.event.BattleEvent;
|
||||
import net.pixvi.myr.view.skill.BaseSkill;
|
||||
import net.pixvi.pfw.display.NetBitImg;
|
||||
import net.pixvi.pfw.driver.EnterFrameDriver;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.utils.Colorator;
|
||||
import net.pixvi.pfw.utils.Jumper;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
|
||||
public class BattleSkillUI extends UIComponent
|
||||
{
|
||||
|
||||
public var mc_container:PiImgContainer;
|
||||
|
||||
public var text_level:PiBitTextField;
|
||||
|
||||
public var text_cost:PiBitTextField;
|
||||
|
||||
public var text_cd:TextField;
|
||||
|
||||
public var img:NetBitImg;
|
||||
|
||||
public var curSkill:BaseSkill;
|
||||
|
||||
public var dark:Boolean = false;
|
||||
|
||||
public var cdjump:Jumper = new Jumper(5);
|
||||
|
||||
public function BattleSkillUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
super.onSkinComplete();
|
||||
mc_container.setSize(89,91);
|
||||
mc_container.x += 5;
|
||||
lightMode(false);
|
||||
this.visible = false;
|
||||
}
|
||||
|
||||
public function onSkill(vo:BaseSkill) : void
|
||||
{
|
||||
if(vo == null)
|
||||
{
|
||||
this.visible = false;
|
||||
return;
|
||||
}
|
||||
curSkill = vo;
|
||||
this.visible = true;
|
||||
text_cost.text = vo.cost.toString();
|
||||
text_level.text = vo.lv.toString();
|
||||
mc_container.fillNetBitImg(vo.imgsrc);
|
||||
TipDriver.getInstance().regist(this,TipCenter.textTipLeft,vo.getTip(),1000);
|
||||
EnterFrameDriver.getInstance().regist(autoCheckMode);
|
||||
GlobalBroadcast.addEventListener(BattleEvent.MONSTER_SKILL,onSomeSkillHandler);
|
||||
}
|
||||
|
||||
private function onSomeSkillHandler(e:BattleEvent) : void
|
||||
{
|
||||
if(e.data == this.curSkill)
|
||||
{
|
||||
autoCheckMode();
|
||||
}
|
||||
}
|
||||
|
||||
public function autoCheckMode() : void
|
||||
{
|
||||
if(this.visible && curSkill != null)
|
||||
{
|
||||
if(curSkill.cder.cooldown)
|
||||
{
|
||||
lightMode();
|
||||
}
|
||||
else
|
||||
{
|
||||
darkMode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function darkMode(check:Boolean = true) : void
|
||||
{
|
||||
if(!dark || !check)
|
||||
{
|
||||
mc_container.transform.colorTransform = Colorator.createDarkTrans(0.3);
|
||||
dark = true;
|
||||
}
|
||||
text_cd.visible = true;
|
||||
var time:Number = curSkill.cder.leftTime / 1000;
|
||||
if(cdjump.jump())
|
||||
{
|
||||
if(time > 0)
|
||||
{
|
||||
if(time > 10)
|
||||
{
|
||||
text_cd.text = Math.floor(time).toString();
|
||||
}
|
||||
else
|
||||
{
|
||||
text_cd.text = time.toFixed(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
text_cd.text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function lightMode(check:Boolean = true) : void
|
||||
{
|
||||
if(dark || !check)
|
||||
{
|
||||
mc_container.transform.colorTransform = Colorator.emptyColorTrans;
|
||||
dark = false;
|
||||
}
|
||||
text_cd.visible = false;
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
EnterFrameDriver.getInstance().remove(autoCheckMode);
|
||||
GlobalBroadcast.removeEventListener(BattleEvent.MONSTER_SKILL,onSomeSkillHandler);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package net.pixvi.myr.battle.view
|
||||
{
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
|
||||
public class BulletCureView extends BulletView
|
||||
{
|
||||
|
||||
public function BulletCureView()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function hit() : void
|
||||
{
|
||||
if(target != null)
|
||||
{
|
||||
target.beCure(1,this.atk);
|
||||
SoundCenter.getIns().play(GameSound.effect_skill_cure);
|
||||
}
|
||||
stop();
|
||||
this.dispose();
|
||||
this.remove = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,250 @@
|
||||
package net.pixvi.myr.battle.view
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.display.Sprite;
|
||||
import flash.events.Event;
|
||||
import flash.utils.getTimer;
|
||||
import net.pixvi.common.driver.StageDriver;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.GameSetting;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.view.attack.BaseAttack;
|
||||
import net.pixvi.myr.view.attack.rocket.BaseBulletRocket;
|
||||
import net.pixvi.myr.view.attack.rocket.type.RocketType;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.display.PiSprite;
|
||||
import net.pixvi.pfw.utils.Locator;
|
||||
import net.pixvi.pfw.utils.PointLocker;
|
||||
|
||||
public class BulletView extends PiSprite
|
||||
{
|
||||
|
||||
public static const HIT_SPACE:int = 30;
|
||||
|
||||
public var target:BattleMon;
|
||||
|
||||
public var targetFloatX:int = 0;
|
||||
|
||||
public var targetFloatY:int = 0;
|
||||
|
||||
public var shooterFloatX:int = 0;
|
||||
|
||||
public var shooterFloatY:int = 0;
|
||||
|
||||
public var targetPoint:Object;
|
||||
|
||||
private var _atk:PointLocker = new PointLocker();
|
||||
|
||||
public var setpow:Number;
|
||||
|
||||
public var spd:Number;
|
||||
|
||||
public var master:BattleMon;
|
||||
|
||||
public var attack:BaseAttack;
|
||||
|
||||
public var img:BitMovieClip;
|
||||
|
||||
public var container:Sprite;
|
||||
|
||||
public var allDistance:Number;
|
||||
|
||||
public var remove:Boolean = false;
|
||||
|
||||
public var action:BaseBulletRocket;
|
||||
|
||||
public var t:TweenMax;
|
||||
|
||||
public var atime:int = 0;
|
||||
|
||||
public var paused:Boolean = false;
|
||||
|
||||
public var force_crit:Boolean = false;
|
||||
|
||||
public var virtualBullet:Boolean = false;
|
||||
|
||||
public var skillBullet:Boolean = false;
|
||||
|
||||
public function BulletView()
|
||||
{
|
||||
super();
|
||||
this.mouseChildren = this.mouseEnabled = false;
|
||||
}
|
||||
|
||||
public function get atk() : int
|
||||
{
|
||||
return _atk.val;
|
||||
}
|
||||
|
||||
public function set atk(value:int) : void
|
||||
{
|
||||
_atk.val = value;
|
||||
}
|
||||
|
||||
public function init(target:BattleMon, master:BattleMon, attack:BaseAttack, setatk:int = -1, setpow:Number = -1) : void
|
||||
{
|
||||
this.target = target;
|
||||
this.master = master;
|
||||
this.attack = attack;
|
||||
if(setatk == -1)
|
||||
{
|
||||
atk = master.all_atk;
|
||||
}
|
||||
else
|
||||
{
|
||||
atk = setatk;
|
||||
}
|
||||
this.setpow = setpow;
|
||||
spd = attack.spd_bullet;
|
||||
targetFloatX = attack.targetFloatX;
|
||||
targetFloatY = attack.targetFloatY;
|
||||
shooterFloatX = attack.shooterFloatX * -master.curFaceto();
|
||||
shooterFloatY = attack.shooterFloatY;
|
||||
allDistance = Locator.getLength3D(target.x,target.y,target.container.y / GameSetting.Y_DISTANCE_SCALE,master.x,master.y,master.container.y / GameSetting.Y_DISTANCE_SCALE);
|
||||
buildView(attack.type_rocket,attack.movie_bullet);
|
||||
t = new TweenMax(this,allTime / 1000,{
|
||||
"x":target.x,
|
||||
"y":target.y,
|
||||
"ease":attack.ease,
|
||||
"onComplete":hit
|
||||
});
|
||||
start();
|
||||
}
|
||||
|
||||
public function getSpd() : Number
|
||||
{
|
||||
if(master != null)
|
||||
{
|
||||
return spd + spd * master.buff.get_movSpd;
|
||||
}
|
||||
return spd;
|
||||
}
|
||||
|
||||
public function lostTarget() : void
|
||||
{
|
||||
targetPoint = {
|
||||
"x":target.x,
|
||||
"y":target.y,
|
||||
"centerXSelf":target.centerXSelf,
|
||||
"centerYSelf":target.centerYSelf
|
||||
};
|
||||
target = null;
|
||||
}
|
||||
|
||||
public function buildView(typeRocket:String, movieBullet:String) : void
|
||||
{
|
||||
container = new Sprite();
|
||||
addChild(container);
|
||||
action = RocketType.getAttack(typeRocket);
|
||||
action.init(container);
|
||||
img = FF.getBMC(movieBullet);
|
||||
if(attack.bulletScale > 0)
|
||||
{
|
||||
img.setScale(attack.bulletScale);
|
||||
}
|
||||
container.addChild(img);
|
||||
container.y = master.container.y + shooterFloatY - master.monMov.height / 2;
|
||||
this.x = master.x + shooterFloatX;
|
||||
this.y = master.y;
|
||||
var shadow:Sprite = FF.getBS("img.Shadow");
|
||||
shadow.scaleX = shadow.scaleY = attack.shadowScale;
|
||||
addChildAt(shadow,0);
|
||||
}
|
||||
|
||||
public function step(e:Event = null) : void
|
||||
{
|
||||
if(paused)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(target != null)
|
||||
{
|
||||
t.updateTo({
|
||||
"x":target.x + targetFloatX,
|
||||
"y":target.y + targetFloatY
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
t.updateTo({
|
||||
"x":targetPoint.x,
|
||||
"y":targetPoint.y
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function start() : void
|
||||
{
|
||||
t.play();
|
||||
if(action != null)
|
||||
{
|
||||
action.start();
|
||||
}
|
||||
atime = getTimer();
|
||||
}
|
||||
|
||||
public function hit() : void
|
||||
{
|
||||
if(target != null)
|
||||
{
|
||||
if(!virtualBullet)
|
||||
{
|
||||
target.beAttack(master,this,-1,false,-1,skillBullet);
|
||||
}
|
||||
dispatchEvent(new MYREvent(MYREvent.BULLET_HIT,{"target":target}));
|
||||
}
|
||||
stop();
|
||||
this.dispose();
|
||||
this.remove = true;
|
||||
}
|
||||
|
||||
public function get allTime() : int
|
||||
{
|
||||
return (allDistance - 30) / getSpd() * (1000 / StageDriver.stage.frameRate);
|
||||
}
|
||||
|
||||
public function pause() : void
|
||||
{
|
||||
if(action != null)
|
||||
{
|
||||
action.pause();
|
||||
}
|
||||
t.pause();
|
||||
}
|
||||
|
||||
public function resume() : void
|
||||
{
|
||||
if(action != null)
|
||||
{
|
||||
action.resume();
|
||||
}
|
||||
t.resume();
|
||||
}
|
||||
|
||||
public function stop() : void
|
||||
{
|
||||
action.stop();
|
||||
if(t != null)
|
||||
{
|
||||
t.kill();
|
||||
}
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
if(t != null)
|
||||
{
|
||||
stop();
|
||||
}
|
||||
removeAllEventListener();
|
||||
if(this.parent != null)
|
||||
{
|
||||
this.parent.removeChild(this);
|
||||
}
|
||||
master = null;
|
||||
action = null;
|
||||
img.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package net.pixvi.myr.battle.view
|
||||
{
|
||||
public class DamageType
|
||||
{
|
||||
|
||||
public static const SKILL:int = 1;
|
||||
|
||||
public static const BASE_ATTACK:int = 2;
|
||||
|
||||
public static const THORNS:int = 3;
|
||||
|
||||
public static const GROUND:int = 4;
|
||||
|
||||
public static const DEAD_BOOM:int = 5;
|
||||
|
||||
public static const SUN_FIRE:int = 6;
|
||||
|
||||
public static const CHEAT:int = 7;
|
||||
|
||||
public static const BUFF_POI:int = 8;
|
||||
|
||||
public static const CONTROLLER_POI:int = 9;
|
||||
|
||||
public static const SELF_SKILL:int = 10;
|
||||
|
||||
public static const VIM:int = 11;
|
||||
|
||||
public static const CONTROLLER_CURE:int = 12;
|
||||
|
||||
public static const MOON_HEAL:int = 13;
|
||||
|
||||
public static const BUFF_CURE:int = 14;
|
||||
|
||||
public function DamageType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package net.pixvi.myr.battle.view.effectmov
|
||||
{
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.view.mon.MonView;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.interfaces.IDispose;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class BaseMonEffectMov implements IDispose
|
||||
{
|
||||
|
||||
public var typeId:String;
|
||||
|
||||
public var lastMov:BitMovieClip;
|
||||
|
||||
public function BaseMonEffectMov()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function startEffect(target:MonView) : void
|
||||
{
|
||||
var rotation:int = int(para.rotation);
|
||||
if(rotation == -1)
|
||||
{
|
||||
rotation = Random.integer(1,360);
|
||||
}
|
||||
try
|
||||
{
|
||||
lastMov = target.addMovByClass(para.mov,para.position,para.scaleX * (para.faceTo ? target.curFaceto() : 1),para.scaleY,para.fps,rotation,para.floatX * (para.faceTo ? target.curFaceto() : 1),para.floatY,null,null,para.top,para.loop);
|
||||
}
|
||||
catch(error:Error)
|
||||
{
|
||||
lastMov = target.addMovByClass(para.mov,para.position,para.scaleX * (para.faceTo ? target.curFaceto() : 1),para.scaleY,para.fps,rotation,para.floatX * (para.faceTo ? target.curFaceto() : 1),para.floatY,null,null,para.top);
|
||||
}
|
||||
}
|
||||
|
||||
public function pause() : void
|
||||
{
|
||||
if(lastMov != null)
|
||||
{
|
||||
lastMov.stop();
|
||||
}
|
||||
}
|
||||
|
||||
public function resume() : void
|
||||
{
|
||||
if(lastMov != null)
|
||||
{
|
||||
lastMov.play();
|
||||
}
|
||||
}
|
||||
|
||||
public function dead() : void
|
||||
{
|
||||
dispose();
|
||||
}
|
||||
|
||||
public function dispose() : void
|
||||
{
|
||||
if(lastMov != null)
|
||||
{
|
||||
lastMov.dispose();
|
||||
lastMov = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function get type() : String
|
||||
{
|
||||
return table().type;
|
||||
}
|
||||
|
||||
public function get movController() : String
|
||||
{
|
||||
return table().movController;
|
||||
}
|
||||
|
||||
public function get para() : Object
|
||||
{
|
||||
return table().para;
|
||||
}
|
||||
|
||||
public function table() : Object
|
||||
{
|
||||
return Table.monster_setting.effectMov[typeId];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package net.pixvi.myr.battle.view.effectmov
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.view.mon.MonView;
|
||||
|
||||
public class MonEffectMovKeep extends BaseMonEffectMov
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public function MonEffectMovKeep()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function startEffect(target:MonView) : void
|
||||
{
|
||||
if(cd == null)
|
||||
{
|
||||
cd = new Cooldowner(para.interval);
|
||||
}
|
||||
if(cd.cooldown)
|
||||
{
|
||||
cd.activity();
|
||||
super.startEffect(target);
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
super.pause();
|
||||
if(cd != null)
|
||||
{
|
||||
cd.pause();
|
||||
}
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
super.resume();
|
||||
if(cd != null)
|
||||
{
|
||||
cd.resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package net.pixvi.myr.battle.view.effectmov
|
||||
{
|
||||
import net.pixvi.myr.center.Table;
|
||||
|
||||
public class MonEffectMovType
|
||||
{
|
||||
|
||||
public static const ATTACK_MOV:String = "attack";
|
||||
|
||||
public static const DEFENCE_MOV:String = "defence";
|
||||
|
||||
public static const NORMAL_MOV:String = "normal";
|
||||
|
||||
public function MonEffectMovType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getMonEffectMovByTypeId(typeId:String) : BaseMonEffectMov
|
||||
{
|
||||
var effect:BaseMonEffectMov = null;
|
||||
switch(Table.monster_setting.effectMov[typeId].movController.toString())
|
||||
{
|
||||
case "1":
|
||||
effect = new BaseMonEffectMov();
|
||||
break;
|
||||
case "2":
|
||||
effect = new MonEffectMovKeep();
|
||||
break;
|
||||
default:
|
||||
effect = new BaseMonEffectMov();
|
||||
}
|
||||
effect.typeId = typeId;
|
||||
return effect;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package net.pixvi.myr.battle.view.piece
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.Game;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
|
||||
public class BattleCostUI extends UIComponent
|
||||
{
|
||||
|
||||
public var text_cost:PiBitTextField;
|
||||
|
||||
public var t:TweenMax;
|
||||
|
||||
public function BattleCostUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("mov.Cost");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
text_cost.mapMode = true;
|
||||
}
|
||||
|
||||
public function prepareShow() : void
|
||||
{
|
||||
this.alpha = 1;
|
||||
if(t != null)
|
||||
{
|
||||
t.kill();
|
||||
t = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function showHide() : void
|
||||
{
|
||||
if(Game.HQ)
|
||||
{
|
||||
t = TweenMax.to(this,0.5,{
|
||||
"alpha":0,
|
||||
"y":this.y - 30,
|
||||
"onComplete":costMovieFinishHandler
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
t = TweenMax.to(this,0.5,{
|
||||
"alpha":0,
|
||||
"y":this.y - 30,
|
||||
"onComplete":costMovieFinishHandler
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private function costMovieFinishHandler() : void
|
||||
{
|
||||
t = null;
|
||||
if(this.parent != null)
|
||||
{
|
||||
this.parent.removeChild(this);
|
||||
this.alpha = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user