Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,203 @@
|
||||
package net.pixvi.myr.panel.battle
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.driver.StageDriver;
|
||||
import net.pixvi.common.effect.effects.JumpToNumEffect;
|
||||
import net.pixvi.myr.battle.BattleModeType;
|
||||
import net.pixvi.myr.center.GuideCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.MasterCenter;
|
||||
import net.pixvi.myr.center.TaskCenter;
|
||||
import net.pixvi.myr.element.battle.BattleVo;
|
||||
import net.pixvi.myr.element.guide.GSub;
|
||||
import net.pixvi.myr.element.reward.RewardShowVo;
|
||||
import net.pixvi.myr.element.reward.RewardType;
|
||||
import net.pixvi.myr.panel.boss.BossStagePanel;
|
||||
import net.pixvi.myr.panel.reward.RewardShowPanel;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class BattleOverPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:BattleOverPanelUI = new BattleOverPanelUI();
|
||||
|
||||
public var iswin:Boolean;
|
||||
|
||||
public var onComplete:Function;
|
||||
|
||||
public var reward:Array;
|
||||
|
||||
public var expRewards:Array;
|
||||
|
||||
private var monListShowFlag:int = 0;
|
||||
|
||||
public function BattleOverPanel()
|
||||
{
|
||||
addChild(ui);
|
||||
PopCenter.getIns().setMaskAlpha(0);
|
||||
super(0.5);
|
||||
}
|
||||
|
||||
public static function getIns() : BattleOverPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(BattleOverPanel) as BattleOverPanel;
|
||||
}
|
||||
|
||||
public function win() : void
|
||||
{
|
||||
ui.mc_continue.alpha = 0;
|
||||
TweenMax.from(ui.mc_win,1,{"alpha":0});
|
||||
TweenMax.fromTo(ui.ui_reward,1,{"alpha":0},{
|
||||
"alpha":1,
|
||||
"onComplete":showTouch
|
||||
});
|
||||
ui.mc_win.visible = ui.ui_reward.visible = true;
|
||||
ui.mc_win.gotoAndPlay(1);
|
||||
ui.ui_reward.text_money.text = "0";
|
||||
ui.ui_reward.text_exp.text = "0";
|
||||
ui.list_mon.setDatas(expRewards);
|
||||
ui.centerList();
|
||||
monListShowFlag = 0;
|
||||
var curbattle:BattleVo = BattlePanel.getIns().battle;
|
||||
if(curbattle.battleMode == BattleModeType.PVE)
|
||||
{
|
||||
ui.text_bossPoint.visible = false;
|
||||
ui.ui_reward.visible = ui.list_mon.visible = false;
|
||||
}
|
||||
else if(curbattle.battleMode == BattleModeType.BOSS)
|
||||
{
|
||||
TweenMax.fromTo(ui.text_bossPoint,0.5,{
|
||||
"alpha":0,
|
||||
"y":ui.text_bossPoint.y - 50
|
||||
},{
|
||||
"alpha":1,
|
||||
"y":ui.text_bossPoint.y,
|
||||
"delay":1
|
||||
});
|
||||
ui.text_bossPoint.visible = true;
|
||||
ui.text_bossPoint.htmlText = BossStagePanel.getIns().curVo.getDamageMsg(BattlePanel.battleData.bossDamage);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.text_bossPoint.visible = false;
|
||||
ui.ui_reward.visible = ui.list_mon.visible = true;
|
||||
monListShow();
|
||||
new JumpToNumEffect(1000,BattlePanel.getIns().battle.reward.money).startEffect(ui.ui_reward.text_money);
|
||||
new JumpToNumEffect(1000,BattlePanel.getIns().battle.reward.exp).startEffect(ui.ui_reward.text_exp);
|
||||
}
|
||||
}
|
||||
|
||||
public function winForSaodang(money:int, exp:int) : void
|
||||
{
|
||||
ui.mc_continue.alpha = 0;
|
||||
TweenMax.from(ui.mc_win,1,{"alpha":0});
|
||||
TweenMax.fromTo(ui.ui_reward,1,{"alpha":0},{
|
||||
"alpha":1,
|
||||
"onComplete":showTouch
|
||||
});
|
||||
ui.mc_win.visible = ui.ui_reward.visible = true;
|
||||
ui.mc_win.gotoAndPlay(1);
|
||||
ui.ui_reward.text_money.text = "0";
|
||||
ui.ui_reward.text_exp.text = "0";
|
||||
ui.list_mon.setDatas(expRewards);
|
||||
ui.centerList();
|
||||
monListShowFlag = 0;
|
||||
ui.text_bossPoint.visible = false;
|
||||
ui.ui_reward.visible = ui.list_mon.visible = true;
|
||||
monListShow();
|
||||
new JumpToNumEffect(1000,money).startEffect(ui.ui_reward.text_money);
|
||||
new JumpToNumEffect(1000,exp).startEffect(ui.ui_reward.text_exp);
|
||||
}
|
||||
|
||||
private function monListShow() : void
|
||||
{
|
||||
if(ui.list_mon.itemArray.length > monListShowFlag && ui.list_mon.itemArray[monListShowFlag].visible)
|
||||
{
|
||||
(ui.list_mon.itemArray[monListShowFlag] as MonExpListItem).showFlash();
|
||||
Caller.delayCall(monListShow,150);
|
||||
monListShowFlag++;
|
||||
}
|
||||
}
|
||||
|
||||
public function showTouch() : void
|
||||
{
|
||||
ui.mc_continue.visible = true;
|
||||
TweenMax.to(ui.mc_continue,0.3,{"alpha":1});
|
||||
StageDriver.stage.addEventListener(MobiEvent.CLICK,clickHandler);
|
||||
}
|
||||
|
||||
public function showover(e:Event = null) : void
|
||||
{
|
||||
StageDriver.stage.removeEventListener(MobiEvent.CLICK,clickHandler);
|
||||
if(onComplete != null)
|
||||
{
|
||||
onComplete();
|
||||
onComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function clickHandler(e:Event = null) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
StageDriver.stage.removeEventListener(MobiEvent.CLICK,clickHandler);
|
||||
if(PopCenter.getIns().topPanel != this)
|
||||
{
|
||||
return;
|
||||
}
|
||||
ui.mc_continue.visible = false;
|
||||
if(reward != null)
|
||||
{
|
||||
for(i = 0; i < reward.length; )
|
||||
{
|
||||
if(reward[i] is RewardShowVo && ((reward[i] as RewardShowVo).rewardType == RewardType.EXP || (reward[i] as RewardShowVo).rewardType == RewardType.MONEY))
|
||||
{
|
||||
reward.splice(i,1);
|
||||
i--;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if(reward != null && reward.length > 0)
|
||||
{
|
||||
RewardShowPanel.show(reward,showover);
|
||||
}
|
||||
else
|
||||
{
|
||||
MasterCenter.getIns().autoCheckLevelUp(true,showover);
|
||||
}
|
||||
}
|
||||
|
||||
public function lose() : void
|
||||
{
|
||||
ui.mc_continue.alpha = 0;
|
||||
TweenMax.from(ui.mc_lose,1,{
|
||||
"alpha":0,
|
||||
"onComplete":showTouch
|
||||
});
|
||||
if(Master.history.guide_record[GSub.FIRST_FAIL] == null && Master.history.passTask["2001001"] == null)
|
||||
{
|
||||
TaskCenter.getIns().receiveTask("2001001",true,receiveFailTask);
|
||||
}
|
||||
else if(BattlePanel.getIns().battlePosition != null && Master.history.guide_record[GSub.MINE_FAIL] == null && ((BattlePanel.getIns().battlePosition.stageId == "0109" || BattlePanel.getIns().battlePosition.stageId == "0108") && BattlePanel.getIns().battlePosition.stageLevel == "1" || BattlePanel.getIns().battlePosition.taskTypeId == "1001007"))
|
||||
{
|
||||
GuideCenter.getIns().fin(GSub.MINE_FAIL);
|
||||
}
|
||||
ui.ui_reward.text_money.text = "";
|
||||
ui.ui_reward.text_exp.text = "";
|
||||
ui.mc_lose.visible = true;
|
||||
ui.mc_lose.gotoAndPlay(1);
|
||||
ui.ui_reward.visible = false;
|
||||
}
|
||||
|
||||
private function receiveFailTask() : void
|
||||
{
|
||||
GuideCenter.getIns().fin(GSub.FIRST_FAIL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package net.pixvi.myr.panel.battle
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import flash.display.Sprite;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiDataList;
|
||||
|
||||
public class BattleOverPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var mc_win:MovieClip;
|
||||
|
||||
public var mc_lose:MovieClip;
|
||||
|
||||
public var ui_reward:BattleOverRewardUI;
|
||||
|
||||
public var mc_continue:Sprite;
|
||||
|
||||
public var list_mon:PiDataList;
|
||||
|
||||
public var text_bossPoint:TextField;
|
||||
|
||||
public function BattleOverPanelUI(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
if(skin == null)
|
||||
{
|
||||
skin = FF.getMC("ui.BattleOverPanelUI");
|
||||
}
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
super.onSkinComplete();
|
||||
list_mon.itemClass = MonExpListItem;
|
||||
mc_lose.visible = mc_win.visible = false;
|
||||
mc_win.stop();
|
||||
mc_lose.stop();
|
||||
}
|
||||
|
||||
public function centerList() : void
|
||||
{
|
||||
list_mon.autoCenterItems(630,95,7,90,100,0,false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package net.pixvi.myr.panel.battle
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
|
||||
public class BattleOverRewardUI extends UIComponent
|
||||
{
|
||||
|
||||
public var text_money:TextField;
|
||||
|
||||
public var text_exp:TextField;
|
||||
|
||||
public function BattleOverRewardUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,560 @@
|
||||
package net.pixvi.myr.panel.battle
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.driver.ActivityDriver;
|
||||
import net.pixvi.common.driver.SecondDriver;
|
||||
import net.pixvi.common.driver.StageDriver;
|
||||
import net.pixvi.common.manager.resource.RM;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.GameSetting;
|
||||
import net.pixvi.myr.battle.BattleGround;
|
||||
import net.pixvi.myr.battle.BattleModeType;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.center.AchiCenter;
|
||||
import net.pixvi.myr.center.GuideCenter;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.MonsterCenter;
|
||||
import net.pixvi.myr.center.RewardCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.achi.AchiType;
|
||||
import net.pixvi.myr.element.battle.BattleData;
|
||||
import net.pixvi.myr.element.battle.BattleMonVo;
|
||||
import net.pixvi.myr.element.battle.BattlePosition;
|
||||
import net.pixvi.myr.element.battle.BattleTeamVo;
|
||||
import net.pixvi.myr.element.battle.BattleVo;
|
||||
import net.pixvi.myr.element.guide.GMain;
|
||||
import net.pixvi.myr.element.reward.RewardResultVo;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.net.NetBattle;
|
||||
import net.pixvi.myr.panel.boss.BossStagePanel;
|
||||
import net.pixvi.myr.panel.help.BattleGuidePanel;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
import net.pixvi.psg.utils.Blacker;
|
||||
|
||||
public class BattlePanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public static var battleData:BattleData;
|
||||
|
||||
public static var autoMIDCount:int = 0;
|
||||
|
||||
public var battle:BattleVo;
|
||||
|
||||
public var ground:BattleGround;
|
||||
|
||||
public var onComplete:Function;
|
||||
|
||||
public var onBattleShowResult:Function;
|
||||
|
||||
public var readyStart:Boolean = true;
|
||||
|
||||
public var battlePosition:BattlePosition;
|
||||
|
||||
public var onWinCallBack:Function;
|
||||
|
||||
public var onLoseCallBack:Function;
|
||||
|
||||
public var battleMode:int = 0;
|
||||
|
||||
private var battleAutoStartSecond:int = 0;
|
||||
|
||||
private var a_needResume:Boolean = false;
|
||||
|
||||
public function BattlePanel()
|
||||
{
|
||||
buffMode = false;
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : BattlePanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(BattlePanel) as BattlePanel;
|
||||
}
|
||||
|
||||
public static function getT() : Cooldowner
|
||||
{
|
||||
return getIns().ground.battleTime;
|
||||
}
|
||||
|
||||
public static function getTempMID() : int
|
||||
{
|
||||
autoMIDCount++;
|
||||
return 100 + autoMIDCount;
|
||||
}
|
||||
|
||||
public function startBuild() : void
|
||||
{
|
||||
var battleTeam:BattleTeamVo = null;
|
||||
var i:int = 0;
|
||||
var battleMon:BattleMon = null;
|
||||
Alert.pauseMsg();
|
||||
if(BattleGround.line == null)
|
||||
{
|
||||
BattleGround.firstStartUp();
|
||||
}
|
||||
ground = new BattleGround();
|
||||
ground.init(battle);
|
||||
ground.loadMovies();
|
||||
addChild(ground);
|
||||
addChild(ground.ui.ui_bottom);
|
||||
addChild(ground.ui.ui_top);
|
||||
addChild(ground.ui.ui_top.btn_pause);
|
||||
ImgCenter.addFsMask(this,"fs2");
|
||||
ground.ui.ui_top.btn_pause.onClick(btnPauseHandler);
|
||||
battleData = new BattleData();
|
||||
battleData.battlePosition = battlePosition;
|
||||
battleData.battleMonIds = [];
|
||||
if(!battle.hideTeamMon)
|
||||
{
|
||||
battleTeam = battle.getTeam(1);
|
||||
for(i = 0; i < battleTeam.mons.length; )
|
||||
{
|
||||
battleMon = battleTeam.mons[i];
|
||||
if(battleMon.monVo.from == "master")
|
||||
{
|
||||
battleData.battleMonIds.push(battleMon.monVo.mid);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
BattleGround.mc_startMov.gotoAndStop(1);
|
||||
BattleGround.mc_startMov.stop();
|
||||
}
|
||||
|
||||
public function btnPauseHandler(e:Event = null) : void
|
||||
{
|
||||
if(ground.battlePauseHandler())
|
||||
{
|
||||
ActivityDriver.getIns().remove(activity,deactivity);
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
}
|
||||
|
||||
public function btnResumeHandler(e:Event = null) : void
|
||||
{
|
||||
ActivityDriver.getIns().regist(activity,deactivity);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
btnPauseHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function battleStartReady() : void
|
||||
{
|
||||
SoundCenter.getIns().bgmPlay(battle.battleBgm());
|
||||
addChild(BattleGround.mc_startMov);
|
||||
StageDriver.setCenter(BattleGround.mc_startMov);
|
||||
BattleGround.mc_startMov.play();
|
||||
BattleGround.mc_startMov.addEventListener("complete",battleStartMovCompleteHandler);
|
||||
BattleGround.mc_startMov.addEventListener("showTip",battleStartMovTipHandler);
|
||||
StageDriver.stage.addEventListener(MobiEvent.CLICK,startMovTouchHandler);
|
||||
ActivityDriver.getIns().regist(activity,deactivity);
|
||||
battleAutoStartSecond = GameSetting.BattleStartCD;
|
||||
SecondDriver.getIns().regist(battleAutoStartSecondHandler);
|
||||
}
|
||||
|
||||
private function battleAutoStartSecondHandler(e:Event = null) : void
|
||||
{
|
||||
battleAutoStartSecond--;
|
||||
if(battleAutoStartSecond <= 0)
|
||||
{
|
||||
startMovTouchHandler();
|
||||
}
|
||||
else
|
||||
{
|
||||
BattleGround.ui_battleTip.text_countDown.text = battleAutoStartSecond.toString();
|
||||
}
|
||||
}
|
||||
|
||||
private function battleStartMovTipHandler(e:Event) : void
|
||||
{
|
||||
BattleGround.ui_battleTip.showType(battle);
|
||||
BattleGround.ui_battleTip.alpha = 0;
|
||||
addChild(BattleGround.ui_battleTip);
|
||||
TweenMax.to(BattleGround.ui_battleTip,0.4,{"alpha":1});
|
||||
}
|
||||
|
||||
private function activity() : void
|
||||
{
|
||||
if(a_needResume && !readyStart)
|
||||
{
|
||||
a_needResume = false;
|
||||
ground.resume();
|
||||
}
|
||||
}
|
||||
|
||||
public function startMovTouchHandler(e:Event = null) : void
|
||||
{
|
||||
if(!BattleGround.mc_startMov.isPlaying)
|
||||
{
|
||||
TweenMax.to(BattleGround.ui_battleTip,0,{
|
||||
"alpha":1,
|
||||
"onComplete":BattleGround.ui_battleTip.removeFromStage
|
||||
});
|
||||
SecondDriver.getIns().remove(battleAutoStartSecondHandler);
|
||||
StageDriver.stage.removeEventListener(MobiEvent.CLICK,startMovTouchHandler);
|
||||
BattleGround.mc_startMov.play();
|
||||
}
|
||||
}
|
||||
|
||||
private function deactivity() : void
|
||||
{
|
||||
if(!ground.paused)
|
||||
{
|
||||
a_needResume = true;
|
||||
ground.pause();
|
||||
}
|
||||
}
|
||||
|
||||
private function battleStartMovCompleteHandler(e:Event = null) : void
|
||||
{
|
||||
var p:BattleGuidePanel = null;
|
||||
p = null;
|
||||
readyStart = false;
|
||||
BattleGround.mc_startMov.stop();
|
||||
removeChild(BattleGround.mc_startMov);
|
||||
BattleGround.mc_startMov.stop();
|
||||
BattleGround.mc_startMov.removeEventListener("complete",battleStartMovCompleteHandler);
|
||||
ground.battleStart(battleCompleteHandler);
|
||||
if(GuideCenter.getIns().checkCur(GMain.battleTeach))
|
||||
{
|
||||
ground.pause();
|
||||
p = new BattleGuidePanel();
|
||||
PopCenter.POP(p);
|
||||
p.onComplete = ground.resume;
|
||||
ground.ui.ui_top.btn_pause.enabled = false;
|
||||
}
|
||||
else if(battle.rollmapMode && !GuideCenter.getIns().checkFin(GMain.battleTeach2))
|
||||
{
|
||||
ground.pause();
|
||||
p = new BattleGuidePanel("2");
|
||||
PopCenter.POP(p);
|
||||
p.onComplete = ground.resume;
|
||||
ground.ui.ui_top.btn_pause.enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ground.ui.ui_top.btn_pause.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function getCheckPack() : Object
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
public function battleCompleteHandler(e:Event = null) : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
autoMIDCount = 0;
|
||||
Alert.resumeMsg();
|
||||
ActivityDriver.getIns().remove(activity,deactivity);
|
||||
cheatCheck();
|
||||
var myteamvo:BattleTeamVo = ground.vo.teamDic["1"] as BattleTeamVo;
|
||||
battleData.leftTime = ground.battleTime.leftTime;
|
||||
battleData.apLeft = myteamvo.ap;
|
||||
battleData.aliveNum = myteamvo.getAliveNum();
|
||||
if(battleMode == BattleModeType.BOSS)
|
||||
{
|
||||
battleData.win = true;
|
||||
if(battleData.bossDamage > BossStagePanel.getIns().curVo.maxDamage)
|
||||
{
|
||||
battleData.bossDamage = BossStagePanel.getIns().curVo.maxDamage;
|
||||
}
|
||||
if(BossStagePanel.getIns().curVo.currentHp <= 0)
|
||||
{
|
||||
battleData.bossDamage = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
battleData.win = ground.winnerTeam == 1;
|
||||
}
|
||||
battleData.killMonster = ground.battleRecords.killMons;
|
||||
battleData.bossDamage = ground.battleRecords.bossPoint.val;
|
||||
if(battleMode == BattleModeType.BOSS && BossStagePanel.getIns().curVo.currentHp <= 0)
|
||||
{
|
||||
battleData.bossDamage = 0;
|
||||
}
|
||||
if(battleData.win)
|
||||
{
|
||||
if(onWinCallBack != null)
|
||||
{
|
||||
onWinCallBack(battleData);
|
||||
onWinCallBack = null;
|
||||
}
|
||||
}
|
||||
else if(onLoseCallBack != null)
|
||||
{
|
||||
onLoseCallBack(battleData);
|
||||
onLoseCallBack = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
showLose();
|
||||
}
|
||||
}
|
||||
|
||||
private function cheatCheck() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var checkmon:BattleMon = null;
|
||||
var montable:Object = null;
|
||||
var skillCheckResult:String = null;
|
||||
var checktable:Object = null;
|
||||
var checktable2:Object = null;
|
||||
var pdata:Object = null;
|
||||
var maxPara:int = 0;
|
||||
var targetPara:int = 0;
|
||||
var maxLevel:int = 0;
|
||||
var realmon:BattleMonVo = null;
|
||||
var cheat:int = 0;
|
||||
var battleteam:BattleTeamVo = ground.vo.teamDic[1];
|
||||
var mons:Array = battleteam.mons.concat(battleteam.deadMons.concat(battleteam.stageMons));
|
||||
var monster_info:Object = RM.TXT.getJson("monster_info").datas;
|
||||
var checkPara:Array = ["atk","def","dex","hp"];
|
||||
if(battleMode == BattleModeType.PVE)
|
||||
{
|
||||
checkPara.pop();
|
||||
}
|
||||
var skillTable:Object = RM.TXT.getJson("monster_skill").datas;
|
||||
var settingTable:Object = RM.TXT.getJson("game_setting");
|
||||
var settingCheckResult:String = "";
|
||||
for(var key:String in settingTable)
|
||||
{
|
||||
if(Table.game_setting[key] is Number && Math.abs(Table.game_setting[key] - settingTable[key]) > 0.001)
|
||||
{
|
||||
battleData.cheatNum += 41;
|
||||
settingCheckResult += "_" + key + "_o" + settingTable[key] + "!=" + Table.game_setting[key];
|
||||
}
|
||||
}
|
||||
if(settingCheckResult != "")
|
||||
{
|
||||
BattlePanel.battleData.cheatRecords.addRecord("+41SettingTable_" + settingCheckResult);
|
||||
}
|
||||
if(battleMode == BattleModeType.BOSS && BattlePanel.battleData.bossDamage > BossStagePanel.getIns().curVo.maxDamage * 1.2)
|
||||
{
|
||||
BattlePanel.battleData.cheatRecords.addRecord("+1BossOverDamage_" + BattlePanel.battleData.bossDamage + "_" + BossStagePanel.getIns().curVo.maxDamage);
|
||||
}
|
||||
for(i = 0; i < mons.length; )
|
||||
{
|
||||
checkmon = mons[i];
|
||||
montable = monster_info[checkmon.vo.type];
|
||||
skillCheckResult = "";
|
||||
if(checkmon.skill_1 != null && checkmon.skill_1.type != 223 && checkmon.skill_1.type != 57 && checkmon.skill_1.type != 229)
|
||||
{
|
||||
checktable = skillTable[checkmon.skill_1.type]["lv" + checkmon.skill_1.lv].para;
|
||||
for(key in checktable)
|
||||
{
|
||||
if(!(checkmon.skill_1.para[key] is Array) && checktable[key] != checkmon.skill_1.para[key])
|
||||
{
|
||||
skillCheckResult += "+41skillTable_" + checkmon.skill_1.type + "_" + key + "_o" + checktable[key] + "!=" + checkmon.skill_1.para[key];
|
||||
battleData.cheatNum += 41;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(checkmon.skill_2 != null && checkmon.skill_2.type != 223 && checkmon.skill_2.type != 57)
|
||||
{
|
||||
checktable2 = skillTable[checkmon.skill_2.type]["lv" + checkmon.skill_2.lv].para;
|
||||
for(key in checktable2)
|
||||
{
|
||||
if(!(checkmon.skill_2.para[key] is Array) && checktable2[key] != checkmon.skill_2.para[key])
|
||||
{
|
||||
skillCheckResult += "+41skillTable_" + checkmon.skill_2.type + "_" + key + "_o" + checktable2[key] + "!=" + checkmon.skill_2.para[key];
|
||||
battleData.cheatNum += 41;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(skillCheckResult != "")
|
||||
{
|
||||
BattlePanel.battleData.cheatRecords.addRecord(skillCheckResult);
|
||||
}
|
||||
if(!(checkmon.monVo.summonUnit || checkmon.monVo.isObject || checkmon.mid < 99999))
|
||||
{
|
||||
if(checkmon.vo.feel > 200)
|
||||
{
|
||||
battleData.cheatNum += 50;
|
||||
BattlePanel.battleData.cheatRecords.addRecord("+15overfeel");
|
||||
}
|
||||
for each(var para:String in checkPara)
|
||||
{
|
||||
if(monster_info[checkmon.vo.type][para] != checkmon.vo.table()[para])
|
||||
{
|
||||
battleData.cheatNum += 15;
|
||||
BattlePanel.battleData.cheatRecords.addRecord("+15overbase");
|
||||
}
|
||||
if(checkmon.monVo[para] > montable[para] + montable[para + "_grow_max"] * (checkmon.monVo.level + checkmon.vo.potentialLevel) * 4)
|
||||
{
|
||||
battleData.cheatNum += 25;
|
||||
BattlePanel.battleData.cheatRecords.addRecord("+15overgrow" + checkmon.mid);
|
||||
}
|
||||
pdata = Table.potential_info.potential[checkmon.vo.job][checkmon.vo.star];
|
||||
maxPara = pdata[para] + pdata[para + "TpAdd"] * checkmon.vo.tplevel;
|
||||
targetPara = int(checkmon.vo["potential_" + para]);
|
||||
if(targetPara > maxPara * 1.5)
|
||||
{
|
||||
battleData.cheatNum += 30;
|
||||
BattlePanel.battleData.cheatRecords.addRecord("+15overpoten");
|
||||
}
|
||||
}
|
||||
maxLevel = GameMath.getMonMaxLevel(checkmon.vo.potentialLevel);
|
||||
if(checkmon.vo.level > maxLevel)
|
||||
{
|
||||
battleData.cheatNum += 50;
|
||||
BattlePanel.battleData.cheatRecords.addRecord("+50overlv");
|
||||
}
|
||||
realmon = MonsterCenter.getIns().getBattleMonVoByMid(checkmon.monVo.mid);
|
||||
cheat = realmon.checkCheat(checkmon.monVo);
|
||||
battleData.cheatRecords.mons.push(checkmon.makeRecord());
|
||||
battleData.cheatNum += cheat;
|
||||
BattlePanel.battleData.cheatRecords.addRecord("+" + cheat + "uneqmon" + checkmon.monVo.mid);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(battleData.cheatNum > 0)
|
||||
{
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
Alert.showMsg("battleData.cheatNum:" + battleData.cheatNum);
|
||||
}
|
||||
battleData.cheatRecords.master = Master.getRecords();
|
||||
}
|
||||
}
|
||||
|
||||
public function showLose(rewardResultVo:RewardResultVo = null) : void
|
||||
{
|
||||
var rewards:Array = null;
|
||||
BattleOverPanel.getIns().lose();
|
||||
showEnd();
|
||||
if(battlePosition != null && battlePosition.isStageBattle())
|
||||
{
|
||||
NetBattle.getIns().battleResult(battlePosition.getStageId(),false);
|
||||
}
|
||||
if(rewardResultVo != null)
|
||||
{
|
||||
rewards = rewardResultVo.getRewardShowArray();
|
||||
if(rewards.length > 0)
|
||||
{
|
||||
BattleOverPanel.getIns().reward = rewards;
|
||||
}
|
||||
RewardCenter.getIns().getReward(rewardResultVo);
|
||||
}
|
||||
}
|
||||
|
||||
public function showWin(reward:RewardResultVo, monsterExps:Array) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var expData:Object = null;
|
||||
var expRewardVo:ExpRewardVo = null;
|
||||
var rewards:Array = null;
|
||||
var monsterExpRewards:Array = [];
|
||||
if(monsterExps != null)
|
||||
{
|
||||
for(i = 0; i < monsterExps.length; )
|
||||
{
|
||||
expData = monsterExps[i];
|
||||
expRewardVo = new ExpRewardVo();
|
||||
expRewardVo.vo = MonsterCenter.getIns().getMonById(expData.monsterId);
|
||||
expRewardVo.oldLevel = expRewardVo.vo.level;
|
||||
expRewardVo.newLevel = expData.level;
|
||||
expRewardVo.levelUp = expData.level != expRewardVo.vo.level;
|
||||
expRewardVo.addExp = expData.exp - expRewardVo.vo.exp;
|
||||
expRewardVo.vo.exp = expData.exp;
|
||||
expRewardVo.vo.level = expData.level;
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.MONSTER_NUM_CHANGE,{"mon":expRewardVo.vo}));
|
||||
monsterExpRewards.push(expRewardVo);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
BattleOverPanel.getIns().expRewards = monsterExpRewards;
|
||||
BattleOverPanel.getIns().win();
|
||||
SoundCenter.getIns().bgmStop();
|
||||
SoundCenter.getIns().play(GameSound.effect_battle_win);
|
||||
Master.history.countBattle++;
|
||||
for(var key:String in battleData.killMonster)
|
||||
{
|
||||
if(Master.history.numKillMonsters[key] == null)
|
||||
{
|
||||
Master.history.numKillMonsters[key] = 0;
|
||||
}
|
||||
var _loc9_:String = key;
|
||||
var _loc10_:Number = Master.history.numKillMonsters[_loc9_] + battleData.killMonster[key];
|
||||
Master.history.numKillMonsters[_loc9_] = _loc10_;
|
||||
}
|
||||
if(reward != null)
|
||||
{
|
||||
rewards = reward.getRewardShowArray();
|
||||
if(rewards.length > 0)
|
||||
{
|
||||
BattleOverPanel.getIns().reward = rewards;
|
||||
}
|
||||
RewardCenter.getIns().getReward(reward);
|
||||
}
|
||||
AchiCenter.getIns().autoCheck(AchiType.HUNTER);
|
||||
guide2();
|
||||
showEnd();
|
||||
if(battle.battleMode != BattleModeType.PVE && battlePosition != null && battlePosition.isStageBattle())
|
||||
{
|
||||
NetBattle.getIns().battleResult(battlePosition.getStageId(),true);
|
||||
}
|
||||
}
|
||||
|
||||
public function showEnd() : void
|
||||
{
|
||||
PopCenter.POP(BattleOverPanel.getIns());
|
||||
BattleOverPanel.getIns().onComplete = yesFinishGameHandler;
|
||||
if(onBattleShowResult != null)
|
||||
{
|
||||
onBattleShowResult(battleData.win);
|
||||
onBattleShowResult = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function yesFinishGameHandler(e:Event = null) : void
|
||||
{
|
||||
Blacker.getIns().show(finishGameShowComplete);
|
||||
}
|
||||
|
||||
public function finishGameShowComplete() : void
|
||||
{
|
||||
if(onComplete != null)
|
||||
{
|
||||
onComplete(battleData.win);
|
||||
onComplete = null;
|
||||
}
|
||||
battleData = null;
|
||||
BattleOverPanel.getIns().showOutAndRemove();
|
||||
this.showOutAndRemove();
|
||||
Blacker.getIns().hide();
|
||||
}
|
||||
|
||||
private function guide2() : void
|
||||
{
|
||||
if(GuideCenter.getIns().checkCur(GMain.battleTeach))
|
||||
{
|
||||
GuideCenter.getIns().fin();
|
||||
}
|
||||
else if(battle.rollmapMode && !GuideCenter.getIns().checkFin(GMain.battleTeach2))
|
||||
{
|
||||
GuideCenter.getIns().fin(GMain.battleTeach2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
package net.pixvi.myr.panel.battle
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.gaooo.nano.center.GAoNano;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.battle.BattleGround;
|
||||
import net.pixvi.myr.center.Game;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class BattlePausePanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:BattlePausePanelUI = new BattlePausePanelUI();
|
||||
|
||||
public function BattlePausePanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
ui.btn_bgm.onClick(bgmHandler);
|
||||
ui.btn_effect.onClick(effectHandler);
|
||||
ui.btn_escape.onClick(escapeHandler);
|
||||
ui.btn_continue.onClick(continueHandler);
|
||||
ui.btn_close.onClick(continueHandler);
|
||||
if(ui.btn_quickSkill != null)
|
||||
{
|
||||
ui.btn_quickSkill.onClick(quickSkillHandler);
|
||||
}
|
||||
}
|
||||
|
||||
public static function getIns() : BattlePausePanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(BattlePausePanel) as BattlePausePanel;
|
||||
}
|
||||
|
||||
public function quickSkillHandler(e:Event = null) : void
|
||||
{
|
||||
ui.btn_quickSkill.switchSelectStatus();
|
||||
Game.getIns().setting.quickSkill = ui.btn_quickSkill.selected;
|
||||
Game.getIns().saveSetting();
|
||||
BattleGround.getIns().quickSkill = ui.btn_quickSkill.selected;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
ui.btn_bgm.selected = Game.getIns().setting.openBgm;
|
||||
ui.btn_effect.selected = Game.getIns().setting.openEffect;
|
||||
update();
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
ui.btn_bgm.selected = Game.getIns().setting.openBgm;
|
||||
ui.btn_effect.selected = Game.getIns().setting.openEffect;
|
||||
if(ui.btn_quickSkill != null)
|
||||
{
|
||||
ui.btn_quickSkill.selected = Game.getIns().setting.quickSkill;
|
||||
}
|
||||
}
|
||||
|
||||
public function bgmHandler(e:Event = null) : void
|
||||
{
|
||||
ui.btn_bgm.switchSelectStatus();
|
||||
SoundCenter.getIns().setBgmEnable(ui.btn_bgm.selected);
|
||||
Game.getIns().setting.openBgm = ui.btn_bgm.selected;
|
||||
GAoNano.getIns().volume = Game.getIns().setting.openBgm ? Game.getIns().setting.globalVolume : 0;
|
||||
Game.getIns().saveSetting();
|
||||
}
|
||||
|
||||
public function effectHandler(e:Event = null) : void
|
||||
{
|
||||
ui.btn_effect.switchSelectStatus();
|
||||
SoundCenter.getIns().setEffectEnable(ui.btn_effect.selected);
|
||||
Game.getIns().setting.openEffect = ui.btn_effect.selected;
|
||||
Game.getIns().saveSetting();
|
||||
}
|
||||
|
||||
public function escapeHandler(e:Event = null) : void
|
||||
{
|
||||
Alert.yesno(lang("逃跑"),lang("逃跑将视作战斗失败,确认要逃走吗?"),yesEscapeHandler);
|
||||
}
|
||||
|
||||
public function yesEscapeHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOut();
|
||||
BattleGround.getIns().run = true;
|
||||
BattleGround.getIns().checkGameOver();
|
||||
}
|
||||
|
||||
public function continueHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOut();
|
||||
PopCenter.getIns().setMaskAlpha(0);
|
||||
BattleGround.getIns().resume();
|
||||
BattlePanel.getIns().btnResumeHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package net.pixvi.myr.panel.battle
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class BattlePausePanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_escape:PiLightButton;
|
||||
|
||||
public var btn_continue:PiLightButton;
|
||||
|
||||
public var btn_bgm:PiLightButton;
|
||||
|
||||
public var btn_effect:PiLightButton;
|
||||
|
||||
public var btn_quickSkill:PiLightButton;
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public function BattlePausePanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.BattlePausePanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
btn_effect.sound_click = GameSound.effect_click1;
|
||||
btn_bgm.sound_click = GameSound.effect_click1;
|
||||
btn_effect.sound_click = GameSound.effect_click1;
|
||||
btn_close.sound_click = GameSound.effect_click_close1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package net.pixvi.myr.panel.battle
|
||||
{
|
||||
import net.pixvi.pfw.utils.PointLocker;
|
||||
|
||||
public class BattleRecords
|
||||
{
|
||||
|
||||
public var killMons:Object;
|
||||
|
||||
public var bossPoint:PointLocker;
|
||||
|
||||
public function BattleRecords()
|
||||
{
|
||||
super();
|
||||
killMons = {};
|
||||
bossPoint = new PointLocker();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package net.pixvi.myr.panel.battle
|
||||
{
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
|
||||
public class ExpRewardVo
|
||||
{
|
||||
|
||||
public var vo:MonsterVo;
|
||||
|
||||
public var addExp:int = 0;
|
||||
|
||||
public var levelUp:Boolean = false;
|
||||
|
||||
public var oldLevel:int = 0;
|
||||
|
||||
public var newLevel:int = 0;
|
||||
|
||||
public function ExpRewardVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package net.pixvi.myr.panel.battle
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Back;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.geom.Point;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.effect.effects.FlashEffect;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.EffectCenter;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.myr.panel.exchange.MonCardSmallUI;
|
||||
import net.pixvi.pfw.display.BitSprite;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiListItem;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
|
||||
public class MonExpListItem extends PiListItem
|
||||
{
|
||||
|
||||
public var ui_card:MonCardSmallUI;
|
||||
|
||||
public var text_exp:PiBitTextField;
|
||||
|
||||
public function MonExpListItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
var vo:ExpRewardVo = value as ExpRewardVo;
|
||||
ui_card.onData(vo.vo,false);
|
||||
ui_card.showLevel(vo.oldLevel);
|
||||
this.ui_card.visible = text_exp.visible = false;
|
||||
if(vo.addExp <= 0)
|
||||
{
|
||||
text_exp.text = "MAX";
|
||||
}
|
||||
else
|
||||
{
|
||||
text_exp.scaleMode = true;
|
||||
text_exp.text = "+" + vo.addExp + "EXP";
|
||||
}
|
||||
}
|
||||
|
||||
public function showFlash() : void
|
||||
{
|
||||
var bs:BitSprite = FF.getBS("mov.ItemFlash",false);
|
||||
ui_card.addChild(bs);
|
||||
TweenMax.fromTo(ui_card,0.2,{"alpha":0},{"alpha":1});
|
||||
this.ui_card.visible = text_exp.visible = true;
|
||||
TweenMax.fromTo(text_exp,0.4,{
|
||||
"y":40,
|
||||
"alpha":0
|
||||
},{
|
||||
"alpha":1,
|
||||
"y":0
|
||||
});
|
||||
TweenMax.to(bs,0.5,{
|
||||
"alpha":0,
|
||||
"ease":Back.easeIn,
|
||||
"onComplete":showFlashComplete
|
||||
});
|
||||
}
|
||||
|
||||
public function showFlashComplete() : void
|
||||
{
|
||||
var vo:ExpRewardVo = data as ExpRewardVo;
|
||||
if(vo.levelUp)
|
||||
{
|
||||
Caller.delayCall(levelUpShow,0.5);
|
||||
}
|
||||
}
|
||||
|
||||
public function levelUpShow() : void
|
||||
{
|
||||
var vo:ExpRewardVo = data as ExpRewardVo;
|
||||
SoundCenter.getIns().play(GameSound.effect_monLevelUp);
|
||||
text_exp.text = lang("等级提升");
|
||||
var p:Point = new Point();
|
||||
p = ui_card.localToGlobal(p);
|
||||
p.x += 45;
|
||||
p.y += 45;
|
||||
EffectCenter.open_effect(p.x,p.y,40,1.4,1.4);
|
||||
TweenMax.fromTo(text_exp,0.4,{
|
||||
"y":40,
|
||||
"alpha":0
|
||||
},{
|
||||
"alpha":1,
|
||||
"y":0
|
||||
});
|
||||
new FlashEffect(400,16777215).startEffect(this);
|
||||
ui_card.showLevel(vo.newLevel);
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
Caller.stopCall(levelUpShow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user