Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
package net.pixvi.myr.panel.boss
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.myr.center.BattleCenter;
|
||||
import net.pixvi.myr.center.BossCenter;
|
||||
import net.pixvi.myr.element.battle.BattleData;
|
||||
import net.pixvi.myr.element.reward.RewardResultVo;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
import net.pixvi.myr.panel.mainmenu.MainMenu;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
import net.pixvi.psg.utils.Blacker;
|
||||
|
||||
public class BossBattleStartPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
private var battleResult:BattleData;
|
||||
|
||||
public function BossBattleStartPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
super(showTime,hideTime);
|
||||
}
|
||||
|
||||
public function startBattle(e:Event = null) : void
|
||||
{
|
||||
BossCenter.getIns().startBoss(BossStagePanel.getIns().curVo.bossId,startBattleHandler);
|
||||
}
|
||||
|
||||
public function startBattleHandler() : void
|
||||
{
|
||||
Blacker.getIns().show(startBattleReady);
|
||||
}
|
||||
|
||||
public function startBattleReady() : void
|
||||
{
|
||||
BossStagePanel.getIns().showOut();
|
||||
BattleCenter.getIns().startBossBattle(BossStagePanel.getIns().curVo,battleComplete,battleOver);
|
||||
BattlePanel.getIns().onWinCallBack = battleWin;
|
||||
BattlePanel.getIns().onLoseCallBack = battleLose;
|
||||
MainMenu.getIns().onOut();
|
||||
Caller.delayCall(Blacker.getIns().hide,100,1,[BattlePanel.getIns().battleStartReady]);
|
||||
}
|
||||
|
||||
public function battleWin(result:BattleData) : void
|
||||
{
|
||||
BossCenter.getIns().endBoss(BossStagePanel.getIns().curVo.bossId,BattlePanel.battleData.bossDamage,BattlePanel.battleData,battleWinHandler);
|
||||
}
|
||||
|
||||
public function battleWinHandler(rewardResultVo:RewardResultVo) : void
|
||||
{
|
||||
BattlePanel.getIns().showWin(rewardResultVo,[]);
|
||||
}
|
||||
|
||||
public function battleLoseHandler(rewardResultVo:RewardResultVo) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function battleLose(result:BattleData) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function battleComplete(winOrLose:Boolean) : void
|
||||
{
|
||||
this.showOut();
|
||||
BossStagePanel.getIns().popIn();
|
||||
SoundCenter.getIns().bgmPlay(GameSound.bgm_farm);
|
||||
}
|
||||
|
||||
public function battleOver(winOrLose:Boolean) : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package net.pixvi.myr.panel.boss
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.element.boss.BossVo;
|
||||
import net.pixvi.myr.element.cost.CostVo;
|
||||
import net.pixvi.myr.panel.task.ItemCardUI;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class BossStageBottom1PanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_start:PiLightButton;
|
||||
|
||||
public var text_ti:TextField;
|
||||
|
||||
public var card_needItem:ItemCardUI;
|
||||
|
||||
public var text_leftNum:PiBitTextField;
|
||||
|
||||
public var mc_cd:Sprite;
|
||||
|
||||
public var text_cd:TextField;
|
||||
|
||||
private var prevNum:int = -1;
|
||||
|
||||
public function BossStageBottom1PanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
text_cd.visible = false;
|
||||
card_needItem.modeNeed = true;
|
||||
}
|
||||
|
||||
public function update(curvo:BossVo) : void
|
||||
{
|
||||
secondUpdate(curvo);
|
||||
if(curvo.getLeftNum() > 0)
|
||||
{
|
||||
btn_start.alpha = 1;
|
||||
btn_start.mouseChildren = btn_start.mouseEnabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_start.alpha = 0.5;
|
||||
btn_start.mouseChildren = btn_start.mouseEnabled = false;
|
||||
}
|
||||
text_ti.text = "×" + curvo.costTi().toString();
|
||||
var cost:CostVo = curvo.battleCost;
|
||||
var showarr:Array = cost.getShowArray(false,false,false);
|
||||
if(showarr.length > 0)
|
||||
{
|
||||
card_needItem.onItemByType(showarr[0].typeId,showarr[0].num);
|
||||
card_needItem.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
card_needItem.visible = false;
|
||||
}
|
||||
text_leftNum.text = lang("剩余次数:") + curvo.getLeftNum() + "/" + curvo.maxNum;
|
||||
}
|
||||
|
||||
public function secondUpdate(curvo:BossVo) : void
|
||||
{
|
||||
if(prevNum == -1 || prevNum != curvo.getLeftNum())
|
||||
{
|
||||
prevNum = curvo.getLeftNum();
|
||||
update(curvo);
|
||||
}
|
||||
if(curvo.getLeftNum() >= curvo.maxNum)
|
||||
{
|
||||
mc_cd.visible = text_cd.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
mc_cd.visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package net.pixvi.myr.panel.boss
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class BossStageBottom2PanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var btn_zhanzheng:PiLightButton;
|
||||
|
||||
public function BossStageBottom2PanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
package net.pixvi.myr.panel.boss
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.effect.effects.FlashEffect;
|
||||
import net.pixvi.myr.element.boss.BossVo;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class BossStageCenterPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var text_hp:PiBitTextField;
|
||||
|
||||
public var mc_hpBoard:MovieClip;
|
||||
|
||||
public var mc_hpBar:MovieClip;
|
||||
|
||||
public var btn_reward:PiLightButton;
|
||||
|
||||
public var text_damage:TextField;
|
||||
|
||||
public var text_process:PiBitTextField;
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public function BossStageCenterPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_img.setSize(390,370);
|
||||
text_hp.scaleMode = true;
|
||||
}
|
||||
|
||||
public function update(boss:BossVo, buffMov:Boolean = false) : void
|
||||
{
|
||||
text_hp.text = boss.showHp + "/" + boss.totalHp;
|
||||
if(container_img.imgSrc != boss.getImg())
|
||||
{
|
||||
container_img.loadNetBitImg(boss.getImg(),true,true,0);
|
||||
}
|
||||
if(buffMov == true)
|
||||
{
|
||||
if(mc_hpBar.currentFrame - 1 != boss.getShowMode())
|
||||
{
|
||||
trace(mc_hpBar.currentFrame,boss.getShowMode());
|
||||
new FlashEffect(900,16777215,1).startEffect(this);
|
||||
}
|
||||
}
|
||||
if(boss.isOver())
|
||||
{
|
||||
modeReward(boss);
|
||||
}
|
||||
else
|
||||
{
|
||||
modeMon();
|
||||
}
|
||||
text_damage.text = boss.pointMsg + boss.damage.toString();
|
||||
text_process.text = int((1 - boss.getShowHpScale()) * 100) + "%";
|
||||
mc_hpBar.scaleX = 1 - boss.getShowHpScale();
|
||||
mc_hpBar.gotoAndStop(boss.getShowMode() + 1);
|
||||
mc_hpBoard.gotoAndStop(boss.getShowMode() + 1);
|
||||
}
|
||||
|
||||
public function modeReward(boss:BossVo) : void
|
||||
{
|
||||
btn_reward.visible = true;
|
||||
if(boss.hasGetReward())
|
||||
{
|
||||
btn_reward.alpha = 0.5;
|
||||
btn_reward.mouseChildren = btn_reward.mouseEnabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_reward.alpha = 1;
|
||||
btn_reward.mouseChildren = btn_reward.mouseEnabled = true;
|
||||
}
|
||||
container_img.visible = false;
|
||||
}
|
||||
|
||||
public function modeMon() : void
|
||||
{
|
||||
btn_reward.visible = false;
|
||||
container_img.visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,426 @@
|
||||
package net.pixvi.myr.panel.boss
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Cubic;
|
||||
import com.greensock.easing.Linear;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.driver.SecondDriver;
|
||||
import net.pixvi.common.effect.effects.FlashEffect;
|
||||
import net.pixvi.common.effect.effects.ShakeEffect;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.common.utils.StageLocator;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.common.view.font.BitNumber;
|
||||
import net.pixvi.myr.battle.BattleGround;
|
||||
import net.pixvi.myr.center.BagCenter;
|
||||
import net.pixvi.myr.center.BossCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.PosCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.center.TeamCenter;
|
||||
import net.pixvi.myr.center.TimeCenter;
|
||||
import net.pixvi.myr.element.boss.BossVo;
|
||||
import net.pixvi.myr.panel.event.EventClickImgPanel;
|
||||
import net.pixvi.myr.panel.mainmenu.MainMenu;
|
||||
import net.pixvi.myr.panel.rank.RankPanel;
|
||||
import net.pixvi.myr.panel.story.StoryPanel;
|
||||
import net.pixvi.myr.panel.team.TeamPanel;
|
||||
import net.pixvi.myr.panel.wild.WildPanel;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.display.NetBitImg;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
import net.pixvi.pfw.utils.Director;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class BossStagePanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public static var userHit:int = 0;
|
||||
|
||||
public var ui:BossStagePanelUI = new BossStagePanelUI();
|
||||
|
||||
public var curVo:BossVo;
|
||||
|
||||
public var hpUpdateCd:Cooldowner;
|
||||
|
||||
public var hitCd:Cooldowner;
|
||||
|
||||
public var img:DisplayObject;
|
||||
|
||||
public var curImg:String = "";
|
||||
|
||||
public function BossStagePanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
hpUpdateCd = new Cooldowner(Table.game_setting.bossHpInternal);
|
||||
hpUpdateCd.activity();
|
||||
hitCd = new Cooldowner(Table.game_setting.bossHitInternal);
|
||||
ui.ui_bottom.btn_start.onClick(startHandler);
|
||||
ui.ui_bottom2.btn_close.onClick(closeHandler);
|
||||
ui.ui_bottom2.btn_zhanzheng.onClick(zhanzhengHandler);
|
||||
ui.ui_top.btn_help.onClick(helpHandler);
|
||||
ui.ui_top.btn_reward.onClick(rewardHandler);
|
||||
ui.ui_top.btn_rank.onClick(rankHandler);
|
||||
ui.ui_center.btn_reward.onClick(getReward);
|
||||
}
|
||||
|
||||
public static function getIns() : BossStagePanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(BossStagePanel) as BossStagePanel;
|
||||
}
|
||||
|
||||
public function helpHandler(e:Event = null) : void
|
||||
{
|
||||
StoryPanel.getIns().start(curVo.helpScript);
|
||||
}
|
||||
|
||||
public function rewardHandler(e:Event = null) : void
|
||||
{
|
||||
PopCenter.POP(new EventClickImgPanel(curVo.rewardImg));
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
hpUpdateCd.activity();
|
||||
if(!curVo.isShow())
|
||||
{
|
||||
runAndClose();
|
||||
return;
|
||||
}
|
||||
curVo.showHp = curVo.currentHp;
|
||||
if(userHit > 0 && !curVo.isOver())
|
||||
{
|
||||
curVo.showHp += userHit;
|
||||
}
|
||||
MainMenu.getIns().onIn();
|
||||
MainMenu.getIns().ui.stageSpMode();
|
||||
PosCenter.activity("boss_" + curVo.bossId);
|
||||
update();
|
||||
addChild(MainMenu.getIns(this));
|
||||
addChild(ui.ui_bottom);
|
||||
addChild(ui.ui_bottom2);
|
||||
MainMenu.getIns().onIn();
|
||||
MainMenu.getIns().ui.stageSpMode();
|
||||
SecondDriver.getIns().regist(secondUpdate);
|
||||
}
|
||||
|
||||
public function getReward(e:Event = null) : void
|
||||
{
|
||||
SecondDriver.getIns().remove(secondUpdate);
|
||||
BossCenter.getIns().getBossReward(curVo.bossId,getRewardComplete);
|
||||
}
|
||||
|
||||
private function getRewardComplete(e:Object = null) : void
|
||||
{
|
||||
Alert.showMsg(curVo.closeMsg);
|
||||
closeHandler();
|
||||
}
|
||||
|
||||
public function startHandler(e:Event = null) : void
|
||||
{
|
||||
if(curVo.currentHp <= 0)
|
||||
{
|
||||
if(curVo.showHp != curVo.currentHp)
|
||||
{
|
||||
curVo.showHp = curVo.currentHp;
|
||||
update();
|
||||
}
|
||||
Alert.yes(curVo.finishTitle,curVo.finishContent,realStart);
|
||||
}
|
||||
else
|
||||
{
|
||||
realStart();
|
||||
}
|
||||
}
|
||||
|
||||
public function realStart() : void
|
||||
{
|
||||
if(curVo.endTime - TimeCenter.timestamp < 15)
|
||||
{
|
||||
Alert.showMsg(lang("地区威胁即将被消除。"));
|
||||
return;
|
||||
}
|
||||
if(curVo.costTi() > Master.ti)
|
||||
{
|
||||
Alert.showMsg(lang("体力不足!"));
|
||||
new FlashEffect(900,16711680,1).startEffect(ui.ui_bottom.text_ti);
|
||||
return;
|
||||
}
|
||||
if(!BagCenter.getIns().checkCost(curVo.battleCost))
|
||||
{
|
||||
Alert.showMsg(lang("必要道具不足!"));
|
||||
new FlashEffect(900,16711680,0.5).startEffect(ui.ui_bottom.card_needItem);
|
||||
return;
|
||||
}
|
||||
if(!TeamCenter.getIns().checkTeamVail(Master.curBattleTeam,true))
|
||||
{
|
||||
return;
|
||||
}
|
||||
var panel:BossBattleStartPanel = new BossBattleStartPanel();
|
||||
PopCenter.POP(panel);
|
||||
panel.startBattle();
|
||||
}
|
||||
|
||||
public function zhanzhengHandler(e:Event) : void
|
||||
{
|
||||
this.showOut();
|
||||
TeamPanel.getIns().modeBattleTeam();
|
||||
TeamPanel.getIns().popInWith(this);
|
||||
MainMenu.getIns().onOut();
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
ui.update(curVo);
|
||||
var nimg:String = curVo.position.mapImg;
|
||||
if(nimg != curImg)
|
||||
{
|
||||
if(img != null)
|
||||
{
|
||||
ui.mc_container.removeChild(img);
|
||||
}
|
||||
img = new NetBitImg(nimg);
|
||||
ui.mc_container.addChild(img);
|
||||
}
|
||||
StageLocator.setfullWithNoFix(ui.mc_container,1);
|
||||
if(curVo.isOver())
|
||||
{
|
||||
ui.ui_bottom.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.ui_bottom.visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function rankHandler(e:Event = null) : void
|
||||
{
|
||||
RankPanel.getIns().setRank(curVo.rankId,lang("地区威胁"),0);
|
||||
RankPanel.getIns().popIn();
|
||||
}
|
||||
|
||||
public function updateHp() : void
|
||||
{
|
||||
if(curVo.isOver())
|
||||
{
|
||||
if(!curVo.updateOver)
|
||||
{
|
||||
update();
|
||||
}
|
||||
return;
|
||||
}
|
||||
BossCenter.getIns().updateBossHp(curVo.bossId,updateHpComplete);
|
||||
}
|
||||
|
||||
private function updateHpComplete(hp:int = 0) : void
|
||||
{
|
||||
ui.ui_center.update(curVo,true);
|
||||
}
|
||||
|
||||
public function runAndClose() : void
|
||||
{
|
||||
closeHandler();
|
||||
Alert.showMsg(curVo.closeMsg);
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOut();
|
||||
SecondDriver.getIns().remove(secondUpdate);
|
||||
WildPanel.getIns().popInWith(this);
|
||||
}
|
||||
|
||||
public function secondUpdate() : void
|
||||
{
|
||||
if(!curVo.isShow())
|
||||
{
|
||||
runAndClose();
|
||||
return;
|
||||
}
|
||||
ui.ui_bottom.secondUpdate(curVo);
|
||||
ui.ui_top.secondUpdate(curVo);
|
||||
if(curVo.isOver() && !curVo.gotoReward)
|
||||
{
|
||||
update();
|
||||
curVo.gotoReward = true;
|
||||
}
|
||||
if(hitCd.cooldown && curVo.showHp > curVo.currentHp)
|
||||
{
|
||||
if(userHit > 0)
|
||||
{
|
||||
Caller.delayCall(showHit,Random.integer(0,100));
|
||||
}
|
||||
else
|
||||
{
|
||||
Caller.delayCall(showHit,Random.integer(0,800));
|
||||
}
|
||||
}
|
||||
if(hpUpdateCd.cooldown)
|
||||
{
|
||||
hpUpdateCd.activity();
|
||||
updateHp();
|
||||
}
|
||||
}
|
||||
|
||||
public function showHit() : void
|
||||
{
|
||||
var maxdamage:int = 0;
|
||||
var perSecond:int = 0;
|
||||
var rand:Number = NaN;
|
||||
var randamage:int = 0;
|
||||
if(curVo.showHp > curVo.currentHp)
|
||||
{
|
||||
maxdamage = curVo.showHp - curVo.currentHp;
|
||||
perSecond = maxdamage / (hpUpdateCd.leftTime / Table.game_setting.bossHitInternal);
|
||||
if(perSecond < curVo.maxDamage * 0.66)
|
||||
{
|
||||
perSecond = curVo.maxDamage * 0.66;
|
||||
}
|
||||
rand = Random.number(0.5,1.5);
|
||||
randamage = perSecond * rand;
|
||||
if(randamage > maxdamage)
|
||||
{
|
||||
randamage = maxdamage;
|
||||
}
|
||||
new FlashEffect(300,16711680,1).startEffect(ui.ui_center.container_img);
|
||||
new ShakeEffect(Random.integer(-5,5),Random.integer(-5,5),0.8).startEffect(ui.ui_center.container_img);
|
||||
if(userHit > 0)
|
||||
{
|
||||
hitNumJump(userHit,true,true);
|
||||
curVo.showHp -= userHit;
|
||||
userHit = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
hitNumJump(randamage,rand > 1 ? true : false);
|
||||
curVo.showHp -= randamage;
|
||||
}
|
||||
ui.ui_center.update(curVo,true);
|
||||
}
|
||||
}
|
||||
|
||||
public function hitNumJump(hitpow:int, isCrit:Boolean = false, isSelf:Boolean = false) : void
|
||||
{
|
||||
var num:BitNumber = null;
|
||||
var hitmov:Object = null;
|
||||
var hitmc:BitMovieClip = null;
|
||||
if(BattleGround.hitNumPool == null)
|
||||
{
|
||||
BattleGround.firstStartUp();
|
||||
}
|
||||
if(BattleGround.hitNumPool.length == 0)
|
||||
{
|
||||
num = new BitNumber(FF.getFC("ui.HurtBitNumber"));
|
||||
}
|
||||
else
|
||||
{
|
||||
num = BattleGround.hitNumPool.get();
|
||||
}
|
||||
num.value = hitpow;
|
||||
var randomw:Number = Random.number(0.2,0.8);
|
||||
var faceto:int = 1;
|
||||
if(randomw < 0.5)
|
||||
{
|
||||
faceto = -1;
|
||||
}
|
||||
num.x = ui.ui_center.container_img.x + ui.ui_center.container_img.width * randomw;
|
||||
num.y = ui.ui_center.container_img.y + ui.ui_center.container_img.height * 0.6;
|
||||
if(curVo.hitMovs.length > 0)
|
||||
{
|
||||
hitmov = Random.element(curVo.hitMovs);
|
||||
hitmc = FF.getBMC(hitmov.mov,hitmov.fps);
|
||||
if(isSelf)
|
||||
{
|
||||
hitmc.setScale(hitmov.scale * 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
hitmc.setScale(hitmov.scale);
|
||||
}
|
||||
hitmc.x = num.x;
|
||||
hitmc.y = num.y;
|
||||
hitmc.rotation = Random.integer(1,360);
|
||||
ui.ui_center.addChild(hitmc);
|
||||
Director.playOnce(hitmc);
|
||||
if(hitmov.snd != null && hitmov.snd != "")
|
||||
{
|
||||
SoundCenter.getIns().play(hitmov.snd);
|
||||
}
|
||||
}
|
||||
var jumpfar:Boolean = false;
|
||||
if(isCrit)
|
||||
{
|
||||
TweenMax.to(num,0,{"tint":16711680});
|
||||
num.scaleX = num.scaleY = 2.5;
|
||||
jumpfar = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
num.scaleX = num.scaleY = 1;
|
||||
}
|
||||
num.scaleY *= 1.3;
|
||||
ui.ui_center.addChild(num);
|
||||
var pyl:Number = Random.number(50,75);
|
||||
pyl *= faceto;
|
||||
if(jumpfar)
|
||||
{
|
||||
TweenMax.to(num,1,{
|
||||
"scaleX":1,
|
||||
"removeTint":true,
|
||||
"scaleY":1,
|
||||
"x":num.x + pyl * 2,
|
||||
"onComplete":recycleHitNum,
|
||||
"onCompleteParams":[num],
|
||||
"ease":Linear.easeOut
|
||||
});
|
||||
TweenMax.to(num,0.5,{
|
||||
"y":num.y - Random.integer(70,90),
|
||||
"ease":Cubic.easeOut,
|
||||
"yoyo":true,
|
||||
"repeat":1
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
TweenMax.to(num,0.8,{
|
||||
"scaleX":1,
|
||||
"scaleY":1,
|
||||
"x":num.x + pyl,
|
||||
"onComplete":recycleHitNum,
|
||||
"onCompleteParams":[num],
|
||||
"ease":Linear.easeOut
|
||||
});
|
||||
TweenMax.to(num,0.4,{
|
||||
"y":num.y - Random.integer(30,50),
|
||||
"ease":Cubic.easeOut,
|
||||
"yoyo":true,
|
||||
"repeat":1
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private function recycleHitNum(hitNum:BitNumber) : void
|
||||
{
|
||||
BattleGround.hitNumPool.drop(hitNum);
|
||||
if(hitNum.parent != null)
|
||||
{
|
||||
hitNum.parent.removeChild(hitNum);
|
||||
}
|
||||
}
|
||||
|
||||
override public function reset() : void
|
||||
{
|
||||
SecondDriver.getIns().remove(secondUpdate);
|
||||
Caller.stopCall(showHit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package net.pixvi.myr.panel.boss
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.common.utils.StageLocator;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.Game;
|
||||
import net.pixvi.myr.element.boss.BossVo;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
|
||||
public class BossStagePanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var mc_container:Sprite;
|
||||
|
||||
public var ui_top:BossStageTopPanelUI;
|
||||
|
||||
public var ui_bottom:BossStageBottom1PanelUI;
|
||||
|
||||
public var ui_bottom2:BossStageBottom2PanelUI;
|
||||
|
||||
public var ui_center:BossStageCenterPanelUI;
|
||||
|
||||
public function BossStagePanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.BossStagePanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
public function update(curVo:BossVo) : void
|
||||
{
|
||||
ui_top.update(curVo);
|
||||
ui_center.update(curVo);
|
||||
ui_bottom.update(curVo);
|
||||
StageLocator.setSide(ui_bottom2.btn_close,"left","none");
|
||||
StageLocator.setSide(ui_bottom2,"none","bottom",0,23);
|
||||
StageLocator.setSide(ui_center,"none","bottom",0,251 - StageLocator.MainFixVo.fix[0] / 2);
|
||||
StageLocator.setSide(ui_bottom,"none","bottom",0,105);
|
||||
if(Game.getIns().setting.liuhaiMode)
|
||||
{
|
||||
StageLocator.setSide(ui_top,"none","top",0,187 + Game.getIns().getLiuHaiAdd());
|
||||
}
|
||||
else
|
||||
{
|
||||
StageLocator.setSide(ui_top,"none","top",0,172);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
package net.pixvi.myr.panel.boss
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.center.TimeCenter;
|
||||
import net.pixvi.myr.element.MonsterElement;
|
||||
import net.pixvi.myr.element.boss.BossVo;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class BossStageTopPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var text_name:PiBitTextField;
|
||||
|
||||
public var text_leftTime:TextField;
|
||||
|
||||
public var btn_help:PiLightButton;
|
||||
|
||||
public var btn_rank:PiLightButton;
|
||||
|
||||
public var btn_reward:PiLightButton;
|
||||
|
||||
public var text_element:TextField;
|
||||
|
||||
public var mc_element:MovieClip;
|
||||
|
||||
public var mc_elementBg:MovieClip;
|
||||
|
||||
public function BossStageTopPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
text_name.scaleMode = true;
|
||||
mc_element.mouseChildren = mc_element.mouseEnabled = false;
|
||||
text_element.mouseEnabled = false;
|
||||
}
|
||||
|
||||
public function update(boss:BossVo) : void
|
||||
{
|
||||
text_name.text = boss.name;
|
||||
if(boss.element == 5)
|
||||
{
|
||||
mc_element.visible = false;
|
||||
mc_elementBg.visible = false;
|
||||
text_element.visible = false;
|
||||
return;
|
||||
}
|
||||
mc_element.visible = true;
|
||||
mc_elementBg.visible = true;
|
||||
text_element.visible = true;
|
||||
mc_element.gotoAndStop(boss.element);
|
||||
text_element.text = lang(MonsterElement.elementBossDes[boss.element]);
|
||||
TipCenter.registTextTip(mc_elementBg,lang(MonsterElement.elementDesDic[boss.element]));
|
||||
secondUpdate(boss);
|
||||
}
|
||||
|
||||
public function secondUpdate(boss:BossVo) : void
|
||||
{
|
||||
if(boss.isOver())
|
||||
{
|
||||
if(text_leftTime.text != boss.overMsg)
|
||||
{
|
||||
text_leftTime.text = boss.overMsg;
|
||||
}
|
||||
return;
|
||||
}
|
||||
var leftTime:int = boss.endTime - TimeCenter.timestamp;
|
||||
if(leftTime < 0)
|
||||
{
|
||||
leftTime = 0;
|
||||
}
|
||||
text_leftTime.text = Paster.secondFormat(leftTime);
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
TipCenter.remove(mc_elementBg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user