Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.center.BagCenter;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
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 EntangleNoUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_makeEntangle:PiLightButton;
|
||||
|
||||
public var container_item:PiImgContainer;
|
||||
|
||||
public var text_msg:PiBitTextField;
|
||||
|
||||
public function EntangleNoUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_item.setSize(60,60);
|
||||
}
|
||||
|
||||
public function update(vo:MonsterVo) : void
|
||||
{
|
||||
var item:ItemVo = BagCenter.getIns().getByType(Table.entangle_info.entangleItem);
|
||||
if(vo.feel != vo.maxFeel)
|
||||
{
|
||||
text_msg.text = lang("好感不足");
|
||||
btn_makeEntangle.visible = false;
|
||||
}
|
||||
else if(item == null || item.num <= 0)
|
||||
{
|
||||
text_msg.text = lang("缺少道具");
|
||||
btn_makeEntangle.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_makeEntangle.visible = true;
|
||||
}
|
||||
if(MyrCenter.channel == "XDG")
|
||||
{
|
||||
text_msg.scaleMode = true;
|
||||
}
|
||||
container_item.loadNetBitImg(ImgCenter.getItemImg(Table.entangle_info.entangleItem));
|
||||
TipCenter.registTextTip(container_item,ItemVo.getName(Table.entangle_info.entangleItem),11);
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
TipCenter.remove(container_item);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,230 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
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.DiaryCenter;
|
||||
import net.pixvi.myr.center.EntangleCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.MonsterCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
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.panel.diary.DiaryStoryListPanel;
|
||||
import net.pixvi.myr.panel.monster.MonsterViewPanel;
|
||||
import net.pixvi.pfw.display.NetBitImg;
|
||||
import net.pixvi.pfw.display.NetImg;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.ui.controls.PiButton;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class EntanglePanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public static var maxEntangleLevel:int = 1;
|
||||
|
||||
public var cur:MonsterVo;
|
||||
|
||||
public var ui:EntanglePanelUI = new EntanglePanelUI();
|
||||
|
||||
public var onComplete:Function;
|
||||
|
||||
public var hasChange:Boolean = false;
|
||||
|
||||
public var img:NetImg;
|
||||
|
||||
private var upstarbtn:PiButton;
|
||||
|
||||
public function EntanglePanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
buffMode = false;
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
ui.ui_no.btn_makeEntangle.onClick(makeEntangle);
|
||||
ui.ui_yes.btn_effect.onClick(effectHandler);
|
||||
ui.ui_yes.btn_reset.onClick(resetHandler);
|
||||
if(ui.ui_yes.btn_upStar1 != null)
|
||||
{
|
||||
ui.ui_yes.btn_upStar1.onClick(upStarHandler);
|
||||
}
|
||||
if(ui.ui_yes.btn_upStar2 != null)
|
||||
{
|
||||
ui.ui_yes.btn_upStar2.onClick(upStarHandler);
|
||||
}
|
||||
}
|
||||
|
||||
public static function getIns() : EntanglePanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(EntanglePanel) as EntanglePanel;
|
||||
}
|
||||
|
||||
public function upStarHandler(e:Event = null) : void
|
||||
{
|
||||
var o:Object = null;
|
||||
var targetStar:int = 0;
|
||||
if(e.currentTarget == ui.ui_yes.btn_upStar1)
|
||||
{
|
||||
targetStar = 1;
|
||||
upstarbtn = ui.ui_yes.btn_upStar1;
|
||||
}
|
||||
if(e.currentTarget == ui.ui_yes.btn_upStar2)
|
||||
{
|
||||
targetStar = 2;
|
||||
upstarbtn = ui.ui_yes.btn_upStar2;
|
||||
}
|
||||
if(cur.upStar >= targetStar)
|
||||
{
|
||||
o = {
|
||||
"name":lang("{0}的升星回放",cur.name),
|
||||
"story":[]
|
||||
};
|
||||
o.story = DiaryCenter.getIns().getTaskAllStory(Table.upstar_info[cur.type].task[targetStar - 1]);
|
||||
DiaryStoryListPanel.getIns().cur = o;
|
||||
PopCenter.POP(DiaryStoryListPanel.getIns());
|
||||
return;
|
||||
}
|
||||
if(Master.history.passTask[cur.upStartTask[targetStar]] == true)
|
||||
{
|
||||
if(cur.skin != Table.upstar_info[cur.type].skin[cur.upStar + 1])
|
||||
{
|
||||
Alert.showMsg(lang("需要切换至升星皮肤【{0}】",Table.skin_info[Table.upstar_info[cur.type].skin[cur.upStar + 1]].name));
|
||||
return;
|
||||
}
|
||||
MonsterCenter.getIns().upStar(cur,upStarComplete);
|
||||
}
|
||||
else
|
||||
{
|
||||
trace("没有完成目标任务");
|
||||
}
|
||||
}
|
||||
|
||||
private function upStarComplete(re:Object) : void
|
||||
{
|
||||
var p:UpStarShowPanel = new UpStarShowPanel();
|
||||
PopCenter.POP(p);
|
||||
p.start(cur.type,0,1);
|
||||
if(ui.ui_yes.upt != null)
|
||||
{
|
||||
ui.ui_yes.upt.kill();
|
||||
}
|
||||
ui.ui_yes.update(cur);
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
PopCenter.getIns().mask.addEventListener(MobiEvent.CLICK,maskHandler);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
update();
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
private function maskHandler(e:Event = null) : void
|
||||
{
|
||||
if(this == PopCenter.getIns().topPanel)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
this.showOut();
|
||||
}
|
||||
|
||||
override public function showOut() : void
|
||||
{
|
||||
PopCenter.getIns().mask.removeEventListener(MobiEvent.CLICK,maskHandler);
|
||||
cur = null;
|
||||
super.showOut();
|
||||
if(hasChange)
|
||||
{
|
||||
MonsterViewPanel.getIns().update(false,true);
|
||||
}
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
if(cur.entangle)
|
||||
{
|
||||
ui.modeYes();
|
||||
ui.ui_yes.update(cur);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.modeNo();
|
||||
ui.ui_no.update(cur);
|
||||
}
|
||||
ui.showEntangleLevel(cur.entangleLevel);
|
||||
ui.text_feel.text = cur.feel + "/" + cur.maxFeel;
|
||||
ui.bar_feel.setValue(cur.feel,200,0,false);
|
||||
if(img != null)
|
||||
{
|
||||
ui.container_lh.removeChild(img);
|
||||
}
|
||||
img = new NetBitImg(cur.getImg("l"));
|
||||
img.x = cur.imgFix["l"].x;
|
||||
img.y = cur.imgFix["l"].y;
|
||||
img.setScale(0.8);
|
||||
ui.container_lh.addChild(img);
|
||||
ui.container_lh.mouseChildren = ui.container_lh.mouseEnabled = false;
|
||||
}
|
||||
|
||||
public function resetHandler(e:Event) : void
|
||||
{
|
||||
var itemvo:ItemVo = BagCenter.getIns().getByType(Table.entangle_info.resetEntangleSkillItem);
|
||||
var itemname:String = ItemVo.getName(Table.entangle_info.resetEntangleSkillItem);
|
||||
if(itemvo == null)
|
||||
{
|
||||
Alert.yes(lang("缺少道具"),lang("重置羁绊效果需要道具:{0}",itemname));
|
||||
return;
|
||||
}
|
||||
Alert.yesno(lang("提示"),lang("是否使用 {0} 来重置该魔物的所有羁绊效果?",itemname),yesResetHandler);
|
||||
}
|
||||
|
||||
private function yesResetHandler() : void
|
||||
{
|
||||
EntangleCenter.getIns().resetEntangleSkill(cur.id,resetCompleteHandler);
|
||||
}
|
||||
|
||||
private function resetCompleteHandler() : void
|
||||
{
|
||||
update();
|
||||
}
|
||||
|
||||
public function effectHandler(e:Event) : void
|
||||
{
|
||||
var effect:String = "";
|
||||
TipCenter.registTextTipLeft(ui.ui_yes.btn_effect,effect);
|
||||
}
|
||||
|
||||
public function makeEntangle(e:Event) : void
|
||||
{
|
||||
EntangleCenter.getIns().makeEntangle(cur.id,makeEntangleHandler);
|
||||
}
|
||||
|
||||
private function makeEntangleHandler() : void
|
||||
{
|
||||
new FlashEffect(1200,16777215,1).startEffect(this);
|
||||
update();
|
||||
GameSound.playMonVoice(cur.type.toString(),"entangle");
|
||||
MonsterViewPanel.getIns().ui.btn_sell.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBar;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EntanglePanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var ui_yes:EntangleYesUI;
|
||||
|
||||
public var ui_no:EntangleNoUI;
|
||||
|
||||
public var text_feel:PiBitTextField;
|
||||
|
||||
public var mc_tag1:MovieClip;
|
||||
|
||||
public var mc_tag2:MovieClip;
|
||||
|
||||
public var mc_tag3:MovieClip;
|
||||
|
||||
public var mc_tag4:MovieClip;
|
||||
|
||||
public var bar_feel:PiBar;
|
||||
|
||||
public var container_lh:Sprite;
|
||||
|
||||
public var mc_mask:Sprite;
|
||||
|
||||
public function EntanglePanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.EntanglePanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
for(i = 1; i <= 4; )
|
||||
{
|
||||
this["mc_tag" + i].stop();
|
||||
i++;
|
||||
}
|
||||
container_lh.mask = mc_mask;
|
||||
}
|
||||
|
||||
public function modeYes() : void
|
||||
{
|
||||
ui_yes.visible = true;
|
||||
ui_no.visible = false;
|
||||
}
|
||||
|
||||
public function modeNo() : void
|
||||
{
|
||||
ui_yes.visible = false;
|
||||
ui_no.visible = true;
|
||||
}
|
||||
|
||||
public function showEntangleLevel(level:int) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
for(i = 1; i <= 4; )
|
||||
{
|
||||
if(level >= i)
|
||||
{
|
||||
this["mc_tag" + i].gotoAndStop(2);
|
||||
}
|
||||
else
|
||||
{
|
||||
this["mc_tag" + i].gotoAndStop(1);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,227 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.Event;
|
||||
import net.gaooo.nano.center.GAoNano;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
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.common.view.FF;
|
||||
import net.pixvi.myr.center.DiaryCenter;
|
||||
import net.pixvi.myr.center.EntangleCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.center.TaskCenter;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.element.task.TaskVo;
|
||||
import net.pixvi.myr.panel.diary.DiaryStoryListPanel;
|
||||
import net.pixvi.myr.panel.task.TaskViewPanel;
|
||||
import net.pixvi.myr.panel.taskstartpanel.TaskStartPanel;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.utils.Director;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EntangleRoadUI extends UIComponent
|
||||
{
|
||||
|
||||
public var mc_pointFeel:MovieClip;
|
||||
|
||||
public var mc_pointTask:MovieClip;
|
||||
|
||||
public var mc_task:MovieClip;
|
||||
|
||||
public var ui_skill:EntangleSkillUI;
|
||||
|
||||
public var level:int = 1;
|
||||
|
||||
public var vo:MonsterVo;
|
||||
|
||||
public function EntangleRoadUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
if(mc_pointFeel != null)
|
||||
{
|
||||
mc_pointFeel.stop();
|
||||
}
|
||||
mc_pointTask.stop();
|
||||
mc_task.stop();
|
||||
PiLightButton.btnTouchLight.setDisplay(mc_task);
|
||||
PiLightButton.btnTouchLight.setDisplay(ui_skill);
|
||||
}
|
||||
|
||||
public function updateByMonster(vo:MonsterVo) : void
|
||||
{
|
||||
var max:int = 0;
|
||||
var canLevelUp:Boolean = false;
|
||||
this.vo = vo;
|
||||
mc_task.removeEventListener(MobiEvent.CLICK,taskHandler);
|
||||
ui_skill.removeEventListener(MobiEvent.CLICK,showEffectHandler);
|
||||
ui_skill.removeEventListener(MobiEvent.CLICK,selectEffectHandler);
|
||||
ui_skill.removeEventListener(MobiEvent.CLICK,unlockEffectHandler);
|
||||
if(vo.entangleLevel >= level)
|
||||
{
|
||||
mc_task.addEventListener(MobiEvent.CLICK,taskHandler);
|
||||
if(vo.entangleSkill[level] != null)
|
||||
{
|
||||
ui_skill.onData(true,vo.entangleSkill[level]);
|
||||
if(mc_pointFeel != null)
|
||||
{
|
||||
mc_pointFeel.gotoAndStop(2);
|
||||
}
|
||||
mc_pointTask.gotoAndStop(2);
|
||||
mc_task.gotoAndStop(3);
|
||||
ui_skill.addEventListener(MobiEvent.CLICK,showEffectHandler);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui_skill.onData(true,null,false);
|
||||
ui_skill.addEventListener(MobiEvent.CLICK,selectEffectHandler);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
max = int(Table.entangle_info.haoganMax[level - 1]);
|
||||
canLevelUp = true;
|
||||
if(vo.feel < max)
|
||||
{
|
||||
canLevelUp = false;
|
||||
if(mc_pointFeel != null)
|
||||
{
|
||||
mc_pointFeel.gotoAndStop(1);
|
||||
}
|
||||
}
|
||||
else if(mc_pointFeel != null)
|
||||
{
|
||||
mc_pointFeel.gotoAndStop(2);
|
||||
}
|
||||
if(Master.history.passTask[vo.entangleTask[level - 1]] != true)
|
||||
{
|
||||
ui_skill.addEventListener(MobiEvent.CLICK,showEffectHandler);
|
||||
canLevelUp = false;
|
||||
if(vo.feel < max)
|
||||
{
|
||||
mc_task.gotoAndStop(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
mc_task.addEventListener(MobiEvent.CLICK,taskHandler);
|
||||
mc_task.gotoAndStop(2);
|
||||
}
|
||||
mc_pointTask.gotoAndStop(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
mc_task.addEventListener(MobiEvent.CLICK,taskHandler);
|
||||
mc_pointTask.gotoAndStop(2);
|
||||
mc_task.gotoAndStop(3);
|
||||
ui_skill.addEventListener(MobiEvent.CLICK,unlockEffectHandler);
|
||||
}
|
||||
ui_skill.onData(false,null,canLevelUp);
|
||||
}
|
||||
}
|
||||
|
||||
public function showEffectHandler(e:Event = null) : void
|
||||
{
|
||||
var taskTypeId:int = int(vo.entangleTask[level - 1]);
|
||||
if(Table.task_info[taskTypeId] == null || Table.task_info[taskTypeId].closed == true)
|
||||
{
|
||||
Alert.showMsg(lang("暂未开放的羁绊"));
|
||||
return;
|
||||
}
|
||||
var p:EntangleSkillSelectPanel = new EntangleSkillSelectPanel();
|
||||
p.startSelect(vo,level,null);
|
||||
p.modeView();
|
||||
PopCenter.POP(p);
|
||||
}
|
||||
|
||||
public function selectEffectHandler(e:Event = null) : void
|
||||
{
|
||||
var p:EntangleSkillSelectPanel = new EntangleSkillSelectPanel();
|
||||
p.startSelect(vo,level,selectEffect);
|
||||
p.modeSelect();
|
||||
PopCenter.POP(p);
|
||||
}
|
||||
|
||||
private function selectEffect(skillId:String) : void
|
||||
{
|
||||
EntangleCenter.getIns().setEntangleSkill(vo.id,skillId,level,selectEffectComplete);
|
||||
}
|
||||
|
||||
private function selectEffectComplete() : void
|
||||
{
|
||||
updateByMonster(vo);
|
||||
EntanglePanel.getIns().hasChange = true;
|
||||
new FlashEffect(900,16777215,1).startEffect(ui_skill);
|
||||
}
|
||||
|
||||
public function taskHandler(e:Event = null) : void
|
||||
{
|
||||
var task:TaskVo = null;
|
||||
var o:Object = null;
|
||||
var taskTypeId:int = int(vo.entangleTask[level - 1]);
|
||||
if(Table.task_info[taskTypeId] == null || Table.task_info[taskTypeId].closed == true)
|
||||
{
|
||||
Alert.showMsg(lang("暂未开放的羁绊"));
|
||||
return;
|
||||
}
|
||||
if(Master.history.passTask[taskTypeId] != true)
|
||||
{
|
||||
task = TaskCenter.getIns().getLocalTaskByTypeId(taskTypeId.toString());
|
||||
if(task != null && task.recieved)
|
||||
{
|
||||
TaskViewPanel.getIns().curvo = task;
|
||||
TaskViewPanel.getIns().popIn();
|
||||
}
|
||||
else
|
||||
{
|
||||
TaskStartPanel.getIns().start(task,null,true);
|
||||
GAoNano.getIns().para["monName"] = vo.shortName;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
o = {
|
||||
"name":lang("{0}的羁绊回放",vo.name),
|
||||
"story":[]
|
||||
};
|
||||
o.story = DiaryCenter.getIns().getTaskAllStory(taskTypeId.toString());
|
||||
DiaryStoryListPanel.getIns().cur = o;
|
||||
PopCenter.POP(DiaryStoryListPanel.getIns());
|
||||
}
|
||||
}
|
||||
|
||||
public function unlockEffectHandler(e:Event = null) : void
|
||||
{
|
||||
EntangleCenter.getIns().entangleLevelUp(vo.id,unlockEffectComplete);
|
||||
}
|
||||
|
||||
public function unlockEffectComplete() : void
|
||||
{
|
||||
var bmc:BitMovieClip = FF.getBMC("mov.SkillStartLevel3",40);
|
||||
bmc.x = ui_skill.x + 41;
|
||||
bmc.y = ui_skill.y + 41;
|
||||
bmc.setScale(1.5);
|
||||
addChild(bmc);
|
||||
Director.playOnce(bmc);
|
||||
EntanglePanel.getIns().update();
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
super.dispose();
|
||||
PiLightButton.btnTouchLight.removeDisplay(mc_task);
|
||||
PiLightButton.btnTouchLight.removeDisplay(ui_skill);
|
||||
TipCenter.remove(ui_skill);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
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.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EntangleSkillListItem extends PiListItem
|
||||
{
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public var text_des:PiBitTextField;
|
||||
|
||||
public var text_name:PiBitTextField;
|
||||
|
||||
public var text_target:PiBitTextField;
|
||||
|
||||
public function EntangleSkillListItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
super.onSkinComplete();
|
||||
if(MyrCenter.channel == "XDG")
|
||||
{
|
||||
text_des.scaleMode = true;
|
||||
text_name.scaleMode = true;
|
||||
text_target.scaleMode = true;
|
||||
}
|
||||
container_img.setSize(70,70);
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
var skill:String = value.toString();
|
||||
var skillData:Object = Table.entangle_skill[skill];
|
||||
if(skillData.addType == "global")
|
||||
{
|
||||
text_target.text = lang("所有魔物");
|
||||
}
|
||||
else
|
||||
{
|
||||
text_target.text = lang("自体");
|
||||
}
|
||||
text_des.text = skillData.des;
|
||||
text_name.text = skillData.name;
|
||||
container_img.loadNetImg(ImgCenter.getEntangleSkillIcon(skill),true,true,0);
|
||||
PiLightButton.btnTouchLight.setDisplay(container_img);
|
||||
this.addEventListener(MobiEvent.CLICK,clickHandler);
|
||||
}
|
||||
|
||||
public function clickHandler(e:Event = null) : void
|
||||
{
|
||||
sendSelect();
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
PiLightButton.btnTouchLight.removeDisplay(container_img);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class EntangleSkillSelectPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:EntangleSkillSelectPanelUI = new EntangleSkillSelectPanelUI();
|
||||
|
||||
public var onComplete:Function;
|
||||
|
||||
public function EntangleSkillSelectPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
buffMode = false;
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
}
|
||||
|
||||
public function modeView() : void
|
||||
{
|
||||
ui.mc_msg.visible = false;
|
||||
}
|
||||
|
||||
public function modeSelect() : void
|
||||
{
|
||||
ui.mc_msg.visible = true;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
ui.list_list.addEventListener("piselect",selectHandler);
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOutAndRemove();
|
||||
}
|
||||
|
||||
public function startSelect(mon:MonsterVo, level:int, onComplete:Function) : void
|
||||
{
|
||||
this.onComplete = onComplete;
|
||||
ui.list_list.setDatas(mon.hasEntangleSkill[level]);
|
||||
}
|
||||
|
||||
public function selectHandler(e:Event) : void
|
||||
{
|
||||
this.showOutAndRemove();
|
||||
if(onComplete == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
ui.list_list.removeEventListener("piselect",selectHandler);
|
||||
var type:String = ui.list_list.curSelectedItemData.toString();
|
||||
onComplete(type);
|
||||
onComplete = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiDataList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EntangleSkillSelectPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var list_list:PiDataList;
|
||||
|
||||
public var mc_msg:Sprite;
|
||||
|
||||
public function EntangleSkillSelectPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.EntangleSkillSelectPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_list.itemClass = EntangleSkillListItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
|
||||
public class EntangleSkillUI extends UIComponent
|
||||
{
|
||||
|
||||
public var mc_add:MovieClip;
|
||||
|
||||
public var mc_lock:MovieClip;
|
||||
|
||||
public var mc_unlock:MovieClip;
|
||||
|
||||
public var container_skill:PiImgContainer;
|
||||
|
||||
public function EntangleSkillUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_skill.setSize(70,70);
|
||||
}
|
||||
|
||||
public function onData(open:Boolean = false, skillType:String = null, canLevelUp:Boolean = false) : void
|
||||
{
|
||||
if(open)
|
||||
{
|
||||
mc_lock.visible = false;
|
||||
mc_unlock.visible = false;
|
||||
if(skillType == null)
|
||||
{
|
||||
container_skill.visible = false;
|
||||
mc_add.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
container_skill.visible = true;
|
||||
mc_add.visible = false;
|
||||
container_skill.loadNetImg(ImgCenter.getEntangleSkillIcon(skillType),true,true,0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
container_skill.visible = false;
|
||||
mc_add.visible = false;
|
||||
if(canLevelUp)
|
||||
{
|
||||
mc_unlock.visible = true;
|
||||
mc_lock.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
mc_unlock.visible = false;
|
||||
mc_lock.visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EntangleYesUI extends UIComponent
|
||||
{
|
||||
|
||||
public var ui_entangle1:EntangleRoadUI;
|
||||
|
||||
public var ui_entangle2:EntangleRoadUI;
|
||||
|
||||
public var ui_entangle3:EntangleRoadUI;
|
||||
|
||||
public var ui_entangle4:EntangleRoadUI;
|
||||
|
||||
public var btn_upStar1:PiLightButton;
|
||||
|
||||
public var btn_upStar2:PiLightButton;
|
||||
|
||||
public var btn_reset:PiLightButton;
|
||||
|
||||
public var btn_effect:PiLightButton;
|
||||
|
||||
public var upt:TweenMax;
|
||||
|
||||
public function EntangleYesUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
ui_entangle1.level = 1;
|
||||
ui_entangle2.level = 2;
|
||||
ui_entangle3.level = 3;
|
||||
ui_entangle4.level = 4;
|
||||
btn_effect.visible = false;
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
upt.kill();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
public function update(vo:MonsterVo) : void
|
||||
{
|
||||
ui_entangle1.updateByMonster(vo);
|
||||
ui_entangle2.updateByMonster(vo);
|
||||
ui_entangle3.updateByMonster(vo);
|
||||
ui_entangle4.updateByMonster(vo);
|
||||
if(btn_upStar1 != null)
|
||||
{
|
||||
TipCenter.remove(btn_upStar1);
|
||||
TipCenter.remove(btn_upStar2);
|
||||
if(vo.upStartTask[1] != null || Master.history.passTask[vo.upStartTask[1]] == true)
|
||||
{
|
||||
btn_upStar1.visible = true;
|
||||
if(vo.upStar > 0)
|
||||
{
|
||||
btn_upStar1.selected = true;
|
||||
TipCenter.registTextTip(btn_upStar1,lang("全属性增加15%"));
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_upStar1.selected = false;
|
||||
if(Master.history.passTask[vo.upStartTask[1]])
|
||||
{
|
||||
TipCenter.registTextTip(btn_upStar1,lang("升星所需契机已达成!"));
|
||||
upt = TweenMax.from(btn_upStar1,0.5,{
|
||||
"tint":16777113,
|
||||
"repeat":999
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
TipCenter.registTextTip(btn_upStar1,lang("缺少升星所需契机!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_upStar1.visible = false;
|
||||
}
|
||||
if(vo.upStartTask[2] != null || Master.history.passTask[vo.upStartTask[2]] == true)
|
||||
{
|
||||
btn_upStar2.visible = true;
|
||||
if(vo.upStar > 1)
|
||||
{
|
||||
btn_upStar2.selected = true;
|
||||
TipCenter.registTextTip(btn_upStar2,lang("全属性增加15%"));
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_upStar2.selected = false;
|
||||
TipCenter.registTextTip(btn_upStar1,lang("升星所需契机已达成!"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_upStar2.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class UpStarShowPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:UpStarShowPanelUI = new UpStarShowPanelUI();
|
||||
|
||||
public function UpStarShowPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
}
|
||||
|
||||
public function start(montype:int, beforeStar:int, afterStar:int) : void
|
||||
{
|
||||
Caller.delayCall(openClick,4000);
|
||||
ui.autoShow(montype,beforeStar,afterStar);
|
||||
}
|
||||
|
||||
public function openClick() : void
|
||||
{
|
||||
stage.addEventListener(MobiEvent.CLICK,clickHandler);
|
||||
}
|
||||
|
||||
public function clickHandler(e:Event = null) : void
|
||||
{
|
||||
stage.removeEventListener(MobiEvent.CLICK,clickHandler);
|
||||
this.showOutAndRemove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Elastic;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.pfw.display.NetBitImg;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
|
||||
public class UpStarShowPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var mc_star:Sprite;
|
||||
|
||||
public var mc_tip:Sprite;
|
||||
|
||||
public var container_lh:Sprite;
|
||||
|
||||
public var container_star:PiImgContainer;
|
||||
|
||||
public var imgBefore:NetBitImg;
|
||||
|
||||
public var imgAfter:NetBitImg;
|
||||
|
||||
public function UpStarShowPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.UpStarShowPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_star.setSize(216,72);
|
||||
}
|
||||
|
||||
public function autoShow(monType:int, star:int, toStar:int) : void
|
||||
{
|
||||
container_star.parent.setChildIndex(container_star,container_star.parent.numChildren - 1);
|
||||
mc_tip.parent.setChildIndex(mc_tip,mc_tip.parent.numChildren - 1);
|
||||
var typeBefore:int = int(star == 0 ? monType : Table.skin_info[monType].skin[star]);
|
||||
var typeAfter:int = int(Table.upstar_info[monType].skin[toStar.toString()]);
|
||||
imgBefore = new NetBitImg(ImgCenter.getMonsterCGImg(typeBefore));
|
||||
imgAfter = new NetBitImg(ImgCenter.getMonsterCGImg(typeAfter));
|
||||
imgBefore.x = ImgCenter.getMonTagFix(typeBefore).x - 90;
|
||||
imgBefore.y = ImgCenter.getMonTagFix(typeBefore).y;
|
||||
imgAfter.x = ImgCenter.getMonTagFix(typeAfter).x - 90;
|
||||
imgAfter.y = ImgCenter.getMonTagFix(typeAfter).y;
|
||||
imgAfter.alpha = 0;
|
||||
container_lh.scaleX = container_lh.scaleY = 0.9;
|
||||
container_lh.addChild(imgBefore);
|
||||
container_lh.addChild(imgAfter);
|
||||
var newStar:int = Table.monster_info[monType].star + toStar;
|
||||
container_star.loadNetBitImg("data/img/common/common_stars_" + newStar + ".png");
|
||||
container_star.alpha = 0;
|
||||
mc_star.alpha = 0;
|
||||
mc_star.scaleX = mc_star.scaleY = 0.4;
|
||||
mc_tip.alpha = 0;
|
||||
SoundCenter.getIns().play(GameSound.soundName("upstar"));
|
||||
TweenMax.to(container_lh,1,{"tint":16777215});
|
||||
TweenMax.to(imgBefore,0.2,{
|
||||
"alpha":0,
|
||||
"delay":1
|
||||
});
|
||||
TweenMax.to(imgAfter,0.2,{
|
||||
"alpha":1,
|
||||
"delay":1
|
||||
});
|
||||
TweenMax.to(container_lh,1,{"tint":16777215});
|
||||
TweenMax.to(container_lh,1,{
|
||||
"removeTint":true,
|
||||
"delay":1.2
|
||||
});
|
||||
TweenMax.to(mc_star,0.5,{
|
||||
"alpha":1,
|
||||
"scaleX":1,
|
||||
"scaleY":1,
|
||||
"ease":Elastic.easeOut,
|
||||
"delay":1.2
|
||||
});
|
||||
TweenMax.to(mc_tip,0.4,{
|
||||
"alpha":1,
|
||||
"y":mc_tip.y - 70,
|
||||
"delay":1.3
|
||||
});
|
||||
TweenMax.to(container_star,0.2,{
|
||||
"alpha":1,
|
||||
"delay":1.3
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user