Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,146 @@
|
||||
package net.pixvi.myr.panel.jxh
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.effect.effects.FlashEffect;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.center.BagCenter;
|
||||
import net.pixvi.myr.center.MonsterCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.panel.monster.MonsterSelectPanel;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class CzAddPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:CzAddPanelUI = new CzAddPanelUI();
|
||||
|
||||
public function CzAddPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
buffMode = false;
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
ui.btn_yes.onClick(startAdd);
|
||||
ui.btn_continue.onClick(continueHandler);
|
||||
update();
|
||||
}
|
||||
|
||||
public function continueHandler(e:Event = null) : void
|
||||
{
|
||||
ui.ui_growth1.mouseChildren = ui.ui_growth1.mouseEnabled = true;
|
||||
ui.ui_growth1.ondata(ui.ui_growth2.mon,true);
|
||||
ui.ui_growth2.ondata(null);
|
||||
ui.btn_continue.visible = false;
|
||||
ui.btn_yes.visible = true;
|
||||
ui.text_itemNum.text = "×" + BagCenter.getIns().getNum(Table.game_setting.czPotion);
|
||||
}
|
||||
|
||||
public function startAdd(e:Event = null) : void
|
||||
{
|
||||
if(ui.ui_growth1.mon.quality == 4)
|
||||
{
|
||||
Alert.showMsg(lang("只可对【S】品质以下的魔物使用。"));
|
||||
return;
|
||||
}
|
||||
var num:int = BagCenter.getIns().getNum(Table.game_setting.czPotion);
|
||||
if(num > 0)
|
||||
{
|
||||
ui.ui_growth2.ondata(ui.ui_growth1.mon);
|
||||
MonsterCenter.getIns().addCz(ui.ui_growth1.mon.id,addCompleteHandler);
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.showMsg(lang("缺少道具【{0}】",ItemVo.getName(Table.game_setting.czPotion)));
|
||||
}
|
||||
}
|
||||
|
||||
public function addCompleteHandler(re:Object = null) : void
|
||||
{
|
||||
ui.ui_growth2.visible = true;
|
||||
ui.btn_yes.visible = false;
|
||||
ui.btn_continue.visible = true;
|
||||
ui.ui_growth1.mouseChildren = ui.ui_growth1.mouseEnabled = false;
|
||||
ui.ui_growth2.ondata(MonsterCenter.getIns().getMonById(ui.ui_growth1.mon.id),true);
|
||||
ui.startSwitchShow(MonsterCenter.getIns().prevAddParaName);
|
||||
if(MonsterCenter.getIns().prevAddParaName != "")
|
||||
{
|
||||
new FlashEffect(2200,16738047).startEffect(ui.ui_growth2["text_" + MonsterCenter.getIns().prevAddParaName]);
|
||||
}
|
||||
ui.text_itemNum.text = "×" + BagCenter.getIns().getNum(Table.game_setting.czPotion);
|
||||
new FlashEffect(900,16777215).startEffect(ui.ui_growth2);
|
||||
}
|
||||
|
||||
public function target1Handler(e:Event) : void
|
||||
{
|
||||
MonsterSelectPanel.getIns().modeSwitch(ui.ui_growth2.mon,true);
|
||||
MonsterSelectPanel.getIns().popIn();
|
||||
MonsterSelectPanel.getIns().addEventListener("complete",target1HandlerComplete);
|
||||
}
|
||||
|
||||
public function target1HandlerComplete(e:Event) : void
|
||||
{
|
||||
MonsterSelectPanel.getIns().removeEventListener("complete",target1HandlerComplete);
|
||||
if(MonsterSelectPanel.selectedComplete)
|
||||
{
|
||||
ui.ui_growth1.ondata(MonsterSelectPanel.selectedMonster);
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
ui.ui_growth1.ondata(null);
|
||||
ui.ui_growth2.ondata(null);
|
||||
ui.ui_growth1.ui_card.addEventListener(MobiEvent.CLICK,target1Handler);
|
||||
PopCenter.getIns().mask.addEventListener(MobiEvent.CLICK,maskClickHandler);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function maskClickHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
ui.text_itemNum.text = "×" + BagCenter.getIns().getNum(Table.game_setting.czPotion);
|
||||
ui.mc_complete.visible = false;
|
||||
ui.btn_yes.visible = false;
|
||||
ui.ui_growth2.visible = false;
|
||||
ui.btn_continue.visible = false;
|
||||
if(ui.ui_growth1.mon != null && (ui.ui_growth2.mon == null || ui.ui_growth2.visible == false))
|
||||
{
|
||||
ui.btn_yes.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.btn_yes.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
PopCenter.getIns().mask.removeEventListener(MobiEvent.CLICK,maskClickHandler);
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
this.showOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package net.pixvi.myr.panel.jxh
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.panel.growswitch.GrowthMonUI;
|
||||
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.Director;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class CzAddPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var btn_yes:PiLightButton;
|
||||
|
||||
public var btn_continue:PiLightButton;
|
||||
|
||||
public var text_itemNum:PiBitTextField;
|
||||
|
||||
public var ui_growth1:GrowthMonUI;
|
||||
|
||||
public var ui_growth2:GrowthMonUI;
|
||||
|
||||
public var mc_complete:Sprite;
|
||||
|
||||
public var mc_switchMov:MovieClip;
|
||||
|
||||
private var movY:Number;
|
||||
|
||||
public var container_item:PiImgContainer;
|
||||
|
||||
public var container_item2:PiImgContainer;
|
||||
|
||||
private var num:int = 0;
|
||||
|
||||
public function CzAddPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.CzAddPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_item.setSize(50,50);
|
||||
container_item2.setSize(50,50);
|
||||
ui_growth2.mouseChildren = ui_growth2.mouseEnabled = false;
|
||||
mc_switchMov.visible = false;
|
||||
mc_switchMov.gotoAndStop(0);
|
||||
movY = mc_switchMov.y;
|
||||
container_item2.loadNetBitImg(ImgCenter.getItemImg(Table.game_setting.czPotion),true,true,0);
|
||||
container_item.loadNetBitImg(ImgCenter.getItemImg(Table.game_setting.czPotion),true,true,0);
|
||||
}
|
||||
|
||||
public function startSwitchShow(para:String = "") : void
|
||||
{
|
||||
num = 0;
|
||||
var numdic:Object = {
|
||||
"hp":0,
|
||||
"atk":1,
|
||||
"def":2,
|
||||
"dex":3
|
||||
};
|
||||
num = numdic[para];
|
||||
mc_switchMov.visible = true;
|
||||
mc_switchMov.y = movY + num * 35;
|
||||
mc_switchMov.gotoAndPlay(1);
|
||||
Director.playOnceMC(mc_switchMov,showNextRow2);
|
||||
}
|
||||
|
||||
private function showNextRow2() : void
|
||||
{
|
||||
mc_switchMov.stop();
|
||||
mc_switchMov.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,235 @@
|
||||
package net.pixvi.myr.panel.jxh
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.common.effect.effects.FlashEffect;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.center.BagCenter;
|
||||
import net.pixvi.myr.center.EffectCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.StackCenter;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.myr.element.stack.StackVo;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.panel.monster.MonsterViewPanel;
|
||||
import net.pixvi.pfw.event.PiEvent;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class JxhPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:JxhPanelUI = new JxhPanelUI();
|
||||
|
||||
public var curStack:StackVo;
|
||||
|
||||
public var curMon:MonsterVo;
|
||||
|
||||
private var buff_addPara:String;
|
||||
|
||||
public function JxhPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
ui.btn_atk.onClick(addHandler);
|
||||
ui.btn_def.onClick(addHandler);
|
||||
ui.btn_hp.onClick(addHandler);
|
||||
ui.btn_dex.onClick(addHandler);
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
}
|
||||
|
||||
public static function getIns() : JxhPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(JxhPanel) as JxhPanel;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
update();
|
||||
if(curStack == null)
|
||||
{
|
||||
this.showOut();
|
||||
}
|
||||
GlobalBroadcast.addEventListener(MYREvent.MONSTER_MODE_CHANGE,modeChangeHandler);
|
||||
}
|
||||
|
||||
public function modeChangeHandler(e:PiEvent = null) : void
|
||||
{
|
||||
if(e.data != null && e.data.id == curMon.id)
|
||||
{
|
||||
showOut();
|
||||
}
|
||||
if(e.data != null && e.data.type == curMon.type)
|
||||
{
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
override public function showOut() : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener(MYREvent.MONSTER_MODE_CHANGE,modeChangeHandler);
|
||||
super.showOut();
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
var mon:MonsterVo = curStack.getMon();
|
||||
ui.container_q.loadNetImg(mon.getImg("1"));
|
||||
ui.text_monName.text = mon.name;
|
||||
ui.text_monNum.text = Master.history.getNumFeedMonster(mon.type).toString();
|
||||
ui.text_monFeedLevel.htmlText = Paster.font("LV:",null,20) + Master.history.getFeedLevel(mon.type);
|
||||
var curExp:int = int(Master.history.getFeedExpCurrent(mon.type));
|
||||
var nextExp:int = int(Master.history.getFeedExpNext(mon.type));
|
||||
if(nextExp == 0)
|
||||
{
|
||||
ui.text_exp.text = "MAX";
|
||||
ui.mc_exp.scaleX = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.text_exp.text = "NEXT:" + curExp + "/" + nextExp;
|
||||
ui.mc_exp.scaleX = curExp / nextExp;
|
||||
}
|
||||
var itemNum:int = BagCenter.getIns().getNum(mon.getJxhItemType());
|
||||
TipCenter.registTextTip(ui.container_item,ItemVo.getTip(mon.getJxhItemType()));
|
||||
TipCenter.registTextTip(ui.container_item2,ItemVo.getTip(mon.getJxhItemType()));
|
||||
ui.container_item.loadNetBitImg(ItemVo.getImgSrc(mon.getJxhItemType()));
|
||||
ui.container_item2.loadNetBitImg(ItemVo.getImgSrc(mon.getJxhItemType()));
|
||||
ui.text_itemNum.text = itemNum.toString();
|
||||
ui.btn_atk.visible = false;
|
||||
ui.btn_def.visible = false;
|
||||
ui.btn_hp.visible = false;
|
||||
ui.btn_dex.visible = false;
|
||||
if(curStack.atkNum < 2)
|
||||
{
|
||||
ui.btn_atk.visible = true;
|
||||
}
|
||||
if(curStack.defNum < 2)
|
||||
{
|
||||
ui.btn_def.visible = true;
|
||||
}
|
||||
if(curStack.hpNum < 2)
|
||||
{
|
||||
ui.btn_hp.visible = true;
|
||||
}
|
||||
if(curStack.dexNum < 2)
|
||||
{
|
||||
ui.btn_dex.visible = true;
|
||||
}
|
||||
ui.text_atkNum.text = 2 - curStack.atkNum + "/2";
|
||||
ui.text_defNum.text = 2 - curStack.defNum + "/2";
|
||||
ui.text_hpNum.text = 2 - curStack.hpNum + "/2";
|
||||
ui.text_dexNum.text = 2 - curStack.dexNum + "/2";
|
||||
if(curStack.atkNum > 0)
|
||||
{
|
||||
ui.mc_atkQuality.visible = true;
|
||||
ui.mc_atkQuality.gotoAndStop(curStack.atkNum + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.mc_atkQuality.visible = false;
|
||||
}
|
||||
if(curStack.hpNum > 0)
|
||||
{
|
||||
ui.mc_hpQuality.visible = true;
|
||||
ui.mc_hpQuality.gotoAndStop(curStack.hpNum + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.mc_hpQuality.visible = false;
|
||||
}
|
||||
if(curStack.defNum > 0)
|
||||
{
|
||||
ui.mc_defQuality.visible = true;
|
||||
ui.mc_defQuality.gotoAndStop(curStack.defNum + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.mc_defQuality.visible = false;
|
||||
}
|
||||
if(curStack.dexNum > 0)
|
||||
{
|
||||
ui.mc_dexQuality.visible = true;
|
||||
ui.mc_dexQuality.gotoAndStop(curStack.dexNum + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.mc_dexQuality.visible = false;
|
||||
}
|
||||
if(curStack.maxJxhNum == 0)
|
||||
{
|
||||
ui.text_leftNum.text = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.text_leftNum.htmlText = Paster.font((curStack.maxJxhNum - curStack.curJxhNum).toString(),null,30) + "/" + curStack.maxJxhNum;
|
||||
}
|
||||
}
|
||||
|
||||
public function addHandler(e:Event = null) : void
|
||||
{
|
||||
var addPara:String = null;
|
||||
if(curStack.maxJxhNum == 0)
|
||||
{
|
||||
Alert.yes(lang("提示"),lang("还无法进行精细化培育,请先提升物种的培育熟练等级。"));
|
||||
return;
|
||||
}
|
||||
if(curStack.curJxhNum >= curStack.maxJxhNum)
|
||||
{
|
||||
Alert.yes(lang("提示"),lang("已达到当前培育熟练等级的最高可培育次数!"));
|
||||
return;
|
||||
}
|
||||
var itemNum:int = BagCenter.getIns().getNum(curMon.getJxhItemType());
|
||||
if(itemNum <= 0)
|
||||
{
|
||||
Alert.yes(lang("提示"),lang("缺少培育道具【{0}】",ItemVo.getName(curMon.getJxhItemType())));
|
||||
return;
|
||||
}
|
||||
switch(e.currentTarget)
|
||||
{
|
||||
case ui.btn_atk:
|
||||
addPara = "atk";
|
||||
break;
|
||||
case ui.btn_def:
|
||||
addPara = "def";
|
||||
break;
|
||||
case ui.btn_hp:
|
||||
addPara = "hp";
|
||||
break;
|
||||
case ui.btn_dex:
|
||||
addPara = "dex";
|
||||
}
|
||||
buff_addPara = addPara;
|
||||
StackCenter.getIns().addQuality(curStack.id,addPara,addCompleteHandler);
|
||||
}
|
||||
|
||||
public function addCompleteHandler(re:Object) : void
|
||||
{
|
||||
SoundCenter.getIns().play(GameSound.effect_monLevelUp);
|
||||
EffectCenter.open_effect(ui["mc_" + buff_addPara + "Quality"].x + 17,17 + ui["mc_" + buff_addPara + "Quality"].y);
|
||||
new FlashEffect(900,16777215).startEffect(ui["mc_" + buff_addPara + "Quality"]);
|
||||
update();
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOut();
|
||||
MonsterViewPanel.getIns().hideInfo();
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
TipCenter.remove(ui.container_item);
|
||||
TipCenter.remove(ui.container_item2);
|
||||
GlobalBroadcast.removeEventListener(MYREvent.MONSTER_MODE_CHANGE,modeChangeHandler);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package net.pixvi.myr.panel.jxh
|
||||
{
|
||||
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.myr.panel.task.ItemCardUI;
|
||||
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 JxhPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var btn_atk:PiLightButton;
|
||||
|
||||
public var btn_def:PiLightButton;
|
||||
|
||||
public var btn_hp:PiLightButton;
|
||||
|
||||
public var btn_dex:PiLightButton;
|
||||
|
||||
public var text_atkNum:PiBitTextField;
|
||||
|
||||
public var text_defNum:PiBitTextField;
|
||||
|
||||
public var text_hpNum:PiBitTextField;
|
||||
|
||||
public var text_dexNum:PiBitTextField;
|
||||
|
||||
public var mc_hpQuality:MovieClip;
|
||||
|
||||
public var mc_atkQuality:MovieClip;
|
||||
|
||||
public var mc_defQuality:MovieClip;
|
||||
|
||||
public var mc_dexQuality:MovieClip;
|
||||
|
||||
public var text_leftNum:PiBitTextField;
|
||||
|
||||
public var text_exp:TextField;
|
||||
|
||||
public var container_q:PiImgContainer;
|
||||
|
||||
public var container_item:PiImgContainer;
|
||||
|
||||
public var container_item2:PiImgContainer;
|
||||
|
||||
public var text_monName:PiBitTextField;
|
||||
|
||||
public var text_monNum:PiBitTextField;
|
||||
|
||||
public var text_monFeedLevel:PiBitTextField;
|
||||
|
||||
public var mc_exp:Sprite;
|
||||
|
||||
public var ui_item:ItemCardUI;
|
||||
|
||||
public var text_itemNum:PiBitTextField;
|
||||
|
||||
public function JxhPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.JxhPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_q.setSize(115,115);
|
||||
container_item.setSize(40,40);
|
||||
container_item2.setSize(40,40);
|
||||
mc_hpQuality.stop();
|
||||
mc_atkQuality.stop();
|
||||
mc_defQuality.stop();
|
||||
mc_dexQuality.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user