Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,125 @@
|
||||
package net.pixvi.myr.element.pve
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.center.PveCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
|
||||
public class PveAreaInfoVo
|
||||
{
|
||||
|
||||
public var hasUpdate:Boolean = false;
|
||||
|
||||
public var oldScore:int = 0;
|
||||
|
||||
public var score:int = 0;
|
||||
|
||||
public var victoryNum:int = 0;
|
||||
|
||||
public var defeatedNum:int = 0;
|
||||
|
||||
public var pveStarting:Boolean = false;
|
||||
|
||||
public var num:int = 0;
|
||||
|
||||
public var preWeekScore:int = 0;
|
||||
|
||||
public var weekRewardGet:Boolean = false;
|
||||
|
||||
public var pveData:String = null;
|
||||
|
||||
public var pveAreaType:String;
|
||||
|
||||
public function PveAreaInfoVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function canGetReward() : Boolean
|
||||
{
|
||||
if(!weekRewardGet && preWeekScore > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getRankVo() : PveRankVo
|
||||
{
|
||||
return PveCenter.getIns().getRankByScore(score);
|
||||
}
|
||||
|
||||
public function areaName() : String
|
||||
{
|
||||
return intoTable().areaName;
|
||||
}
|
||||
|
||||
public function teamName() : String
|
||||
{
|
||||
return intoTable().teamName;
|
||||
}
|
||||
|
||||
public function getNumMax(onum:int) : int
|
||||
{
|
||||
if(intoTable().numMax == null)
|
||||
{
|
||||
return onum;
|
||||
}
|
||||
return intoTable().numMax;
|
||||
}
|
||||
|
||||
public function areaXiandinDes() : String
|
||||
{
|
||||
if(Table.team_info.teamMonTypes != null && Table.team_info.teamMonTypes[teamName()] != null)
|
||||
{
|
||||
return Table.team_info.teamMonTypesDes[teamName()].name;
|
||||
}
|
||||
return lang("星级限定");
|
||||
}
|
||||
|
||||
public function areaStar() : String
|
||||
{
|
||||
if(Table.team_info.teamMonTypes != null && Table.team_info.teamMonTypes[teamName()] != null)
|
||||
{
|
||||
return lang("限");
|
||||
}
|
||||
return intoTable().maxStar;
|
||||
}
|
||||
|
||||
public function iconImg() : String
|
||||
{
|
||||
return intoTable().iconImg;
|
||||
}
|
||||
|
||||
public function intoTable() : Object
|
||||
{
|
||||
return Table.pve_info.pveArea[pveAreaType];
|
||||
}
|
||||
|
||||
public function botType() : String
|
||||
{
|
||||
if(intoTable().botType != null)
|
||||
{
|
||||
return intoTable().botType;
|
||||
}
|
||||
return "normal";
|
||||
}
|
||||
|
||||
public function onData(datas:Object, typeName:String) : void
|
||||
{
|
||||
this.pveAreaType = typeName;
|
||||
if(datas == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
score = datas.score;
|
||||
victoryNum = datas.victoryNum;
|
||||
defeatedNum = datas.defeatedNum;
|
||||
pveStarting = datas.pveStarting == 1 ? true : false;
|
||||
num = datas.num;
|
||||
preWeekScore = datas.preWeekScore;
|
||||
weekRewardGet = datas.weekRewardGet == 1 ? true : false;
|
||||
pveData = datas.pveData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package net.pixvi.myr.element.pve
|
||||
{
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.panel.pve.PveBattleDataVo;
|
||||
import net.pixvi.myr.panel.pve.PveMasterInfoVo;
|
||||
|
||||
public class PveCharaDataVo
|
||||
{
|
||||
|
||||
public var masterInfo:PveMasterInfoVo;
|
||||
|
||||
public var pveBattleData:PveBattleDataVo;
|
||||
|
||||
public var pveTeamInfo:Array;
|
||||
|
||||
public var isBot:Boolean = false;
|
||||
|
||||
public function PveCharaDataVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function onData(datas:Object) : void
|
||||
{
|
||||
masterInfo = new PveMasterInfoVo();
|
||||
masterInfo.onData(datas.masterInfo);
|
||||
pveTeamInfo = datas.pveTeamInfo;
|
||||
pveBattleData = new PveBattleDataVo();
|
||||
pveBattleData.onData(datas.pveBattleData,this);
|
||||
}
|
||||
|
||||
public function onBot(botData:Object, area:PveAreaInfoVo) : void
|
||||
{
|
||||
var j:int = 0;
|
||||
var i:int = 0;
|
||||
masterInfo = new PveMasterInfoVo();
|
||||
masterInfo.onBot(botData,area);
|
||||
pveBattleData = new PveBattleDataVo();
|
||||
pveBattleData.onBot(botData,area);
|
||||
pveTeamInfo = [];
|
||||
for(j = 0; j < botData.teamData.mons.length; )
|
||||
{
|
||||
if(botData.teamData.mons[j].ai <= 0)
|
||||
{
|
||||
botData.teamData.mons[j].ai = 2;
|
||||
}
|
||||
if(botData.teamData.mons[j].search_ai <= 0)
|
||||
{
|
||||
botData.teamData.mons[j].search_ai = 2;
|
||||
}
|
||||
pveTeamInfo[botData.teamData.mons[j].teamPos] = botData.teamData.mons[j];
|
||||
j++;
|
||||
}
|
||||
for(i = 0; i < Table.team_info.battleTeamMaxNum; )
|
||||
{
|
||||
if(pveTeamInfo[i] == null)
|
||||
{
|
||||
pveTeamInfo[i] = -1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
pveTeamInfo = pveTeamInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package net.pixvi.myr.element.pve
|
||||
{
|
||||
import net.pixvi.myr.center.Table;
|
||||
|
||||
public class PveInfoVo
|
||||
{
|
||||
|
||||
public var pve_lah:PveAreaInfoVo;
|
||||
|
||||
public var pve_bslm:PveAreaInfoVo;
|
||||
|
||||
public var pve_nslm:PveAreaInfoVo;
|
||||
|
||||
public var pve_lrj:PveAreaInfoVo;
|
||||
|
||||
public var pve_llts:PveAreaInfoVo;
|
||||
|
||||
public function PveInfoVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function canGetReward() : Boolean
|
||||
{
|
||||
var pvearea:PveAreaInfoVo = null;
|
||||
var i:int = 0;
|
||||
var arr:Array = [pve_lah,pve_bslm,pve_nslm,pve_lrj,pve_llts];
|
||||
var allZero:Boolean = true;
|
||||
for(i = 0; i < arr.length; )
|
||||
{
|
||||
if(arr[i] != null)
|
||||
{
|
||||
pvearea = arr[i] as PveAreaInfoVo;
|
||||
if(pvearea.weekRewardGet)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(pvearea.preWeekScore > 0)
|
||||
{
|
||||
allZero = false;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(allZero)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getTopArea() : PveAreaInfoVo
|
||||
{
|
||||
var arr:Array = null;
|
||||
if(pve_llts == null)
|
||||
{
|
||||
arr = [pve_lah,pve_bslm,pve_nslm,pve_lrj];
|
||||
}
|
||||
else
|
||||
{
|
||||
arr = [pve_lah,pve_bslm,pve_nslm,pve_lrj,pve_llts];
|
||||
}
|
||||
var topArea:PveAreaInfoVo = null;
|
||||
for each(var a:PveAreaInfoVo in arr)
|
||||
{
|
||||
if(topArea == null || topArea.preWeekScore < a.preWeekScore)
|
||||
{
|
||||
topArea = a;
|
||||
}
|
||||
}
|
||||
return topArea;
|
||||
}
|
||||
|
||||
public function pveLeftNum() : int
|
||||
{
|
||||
if(pve_llts == null)
|
||||
{
|
||||
return Table.pve_info.pveDayNum - pve_bslm.num - pve_lah.num - pve_lrj.num - pve_nslm.num;
|
||||
}
|
||||
return Table.pve_info.pveDayNum - pve_bslm.num - pve_lah.num - pve_lrj.num - pve_nslm.num - pve_llts.num;
|
||||
}
|
||||
|
||||
public function pveMaxNum() : int
|
||||
{
|
||||
return Table.pve_info.pveDayNum;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package net.pixvi.myr.element.pve
|
||||
{
|
||||
import net.pixvi.myr.center.Table;
|
||||
|
||||
public class PveRankVo
|
||||
{
|
||||
|
||||
public var rankType:String = "";
|
||||
|
||||
public function PveRankVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function table() : Object
|
||||
{
|
||||
return Table.pve_info.rankInfo[rankType];
|
||||
}
|
||||
|
||||
public function get name() : String
|
||||
{
|
||||
return table().name;
|
||||
}
|
||||
|
||||
public function get img() : String
|
||||
{
|
||||
return table().img;
|
||||
}
|
||||
|
||||
public function rankImgSrc() : String
|
||||
{
|
||||
return "data/img/common/match_rank_" + img + ".png";
|
||||
}
|
||||
|
||||
public function get score() : int
|
||||
{
|
||||
return table().score;
|
||||
}
|
||||
|
||||
public function hasNextRank() : Boolean
|
||||
{
|
||||
if(Table.pve_info.rankInfo[int(rankType) + 1] != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function nextName() : String
|
||||
{
|
||||
if(Table.pve_info.rankInfo[int(rankType) + 1] != null)
|
||||
{
|
||||
return Table.pve_info.rankInfo[int(rankType) + 1].name;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public function nextScore() : String
|
||||
{
|
||||
if(Table.pve_info.rankInfo[int(rankType) + 1] != null)
|
||||
{
|
||||
return Table.pve_info.rankInfo[int(rankType) + 1].score;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user