Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
package net.pixvi.myr.element.master
|
||||
{
|
||||
import net.pixvi.common.utils.PiObject;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.util.MyrCalendar;
|
||||
|
||||
public class ActivityHistoryVo extends PiObject
|
||||
{
|
||||
|
||||
public var dailyGiftCheckTime:Number = 0;
|
||||
|
||||
public var dailyGiftLevel:int = 1;
|
||||
|
||||
public var dailyGiftCount:int = 0;
|
||||
|
||||
public var dailyGiftSignCount:int = 0;
|
||||
|
||||
public var loopCheckRewardTime:Number = 0;
|
||||
|
||||
public var dailyCheckCount:int = 0;
|
||||
|
||||
public var dailyCheckTime:Number = 0;
|
||||
|
||||
public var vipCheckTime:Number = 0;
|
||||
|
||||
public var resetPveTime:Number = 0;
|
||||
|
||||
public var weekTaskStatus:Object = {};
|
||||
|
||||
public var stageRewardStatus:Array = [];
|
||||
|
||||
public var getStageRewardTime:uint = 0;
|
||||
|
||||
public function ActivityHistoryVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function loadActivityData(data:Object) : void
|
||||
{
|
||||
dailyGiftCheckTime = data.dailyGift.dailyGiftCheckTime / 1000;
|
||||
dailyGiftLevel = data.dailyGift.dailyGiftLevel;
|
||||
if(data.dailyGift.dailyRewardGetTime != null)
|
||||
{
|
||||
loopCheckRewardTime = data.dailyGift.dailyRewardGetTime / 1000;
|
||||
}
|
||||
dailyGiftCount = data.dailyGift.dailyGiftCount;
|
||||
dailyGiftSignCount = data.dailyGift.signCount;
|
||||
if(data.dailyCheck == null)
|
||||
{
|
||||
data.dailyCheck = {
|
||||
"checkDay":0,
|
||||
"checkTime":0
|
||||
};
|
||||
}
|
||||
dailyCheckCount = data.dailyCheck.checkDay;
|
||||
dailyCheckTime = data.dailyCheck.checkTime;
|
||||
if(data.weekActivityGetReward != null)
|
||||
{
|
||||
weekTaskStatus["getReward"] = data.weekActivityGetReward;
|
||||
}
|
||||
if(data.vipInfo == null)
|
||||
{
|
||||
data.vipInfo = {
|
||||
"getTime":0,
|
||||
"vipTime":0
|
||||
};
|
||||
}
|
||||
vipCheckTime = data.vipInfo.getTime;
|
||||
if(data.resetPveTime != null)
|
||||
{
|
||||
resetPveTime = data.resetPveTime;
|
||||
}
|
||||
}
|
||||
|
||||
public function loopCheckRewardDayNum() : int
|
||||
{
|
||||
if(Table.activity_info.loopCheckReward == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
var continueNum:int = int(Master.activityHistory.dailyGiftCount);
|
||||
var daySpace:int = MyrCalendar.getDayNumber(Master.activityHistory.dailyGiftCheckTime * 1000) - MyrCalendar.getDayNumber(loopCheckRewardTime * 1000);
|
||||
if(daySpace < 0)
|
||||
{
|
||||
daySpace = 0;
|
||||
}
|
||||
var targetDay:int = int(Table.activity_info.loopCheckReward.dayNum);
|
||||
var minNum:int = targetDay;
|
||||
if(continueNum < targetDay)
|
||||
{
|
||||
minNum = continueNum;
|
||||
}
|
||||
if(daySpace < targetDay && daySpace < minNum)
|
||||
{
|
||||
minNum = daySpace;
|
||||
}
|
||||
return minNum;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,483 @@
|
||||
package net.pixvi.myr.element.master
|
||||
{
|
||||
import net.pixvi.common.utils.PiObject;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.center.TaskCenter;
|
||||
import net.pixvi.myr.element.guide.GMain;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.element.room.RoomVo;
|
||||
import net.pixvi.myr.element.stack.StackOpenType;
|
||||
import net.pixvi.myr.element.stack.StackVo;
|
||||
import net.pixvi.myr.element.task.TaskVo;
|
||||
|
||||
public class HistoryVo extends PiObject
|
||||
{
|
||||
|
||||
public static var voVersion:int = 1;
|
||||
|
||||
public var numAddMoney:int = 0;
|
||||
|
||||
public var numFeedMonsters:Object = {};
|
||||
|
||||
public var numKillMonsters:Object = {};
|
||||
|
||||
public var numChicken:int = 2;
|
||||
|
||||
public var countMonster:int = 1;
|
||||
|
||||
public var countEgg:int = 1;
|
||||
|
||||
public var countStack:int = 0;
|
||||
|
||||
public var countItem:int = 0;
|
||||
|
||||
public var countAlchemy:int = 0;
|
||||
|
||||
public var countRoom:int = 1;
|
||||
|
||||
public var countBattle:int = 0;
|
||||
|
||||
public var historyGacha:Object = {};
|
||||
|
||||
public var passStory:Object = {};
|
||||
|
||||
public var unlockStage:Object = {};
|
||||
|
||||
public var passStage:Object = {};
|
||||
|
||||
public var passTask:Object = {};
|
||||
|
||||
public var passAchi:Array = [];
|
||||
|
||||
public var unlockTask:Object = {};
|
||||
|
||||
public var unlockCity:Object = {};
|
||||
|
||||
public var equipLib:Array = [];
|
||||
|
||||
public var guide_main:String = "firstStory";
|
||||
|
||||
public var guide_record:Object = {};
|
||||
|
||||
public var pullMenu:int = 0;
|
||||
|
||||
public var eventTimeTag:Object = {};
|
||||
|
||||
public var stageTag:String = "";
|
||||
|
||||
public var stageLevelTag:String = "";
|
||||
|
||||
public var monLib:Array;
|
||||
|
||||
public var loopTask:Object = {};
|
||||
|
||||
public var loopTaskTime:uint = 0;
|
||||
|
||||
public var loopTaskNum:int = 0;
|
||||
|
||||
public var shopNum:Object;
|
||||
|
||||
public var payPoint:int = 0;
|
||||
|
||||
public var payTypeCount:Object = {};
|
||||
|
||||
public var payTypeDayCount:Object;
|
||||
|
||||
public var payGiftTypes:Object = {};
|
||||
|
||||
public var exchangeNum:Object = {};
|
||||
|
||||
public var unlockSkins:Array = [];
|
||||
|
||||
public var timeEggItems:Array = [];
|
||||
|
||||
public function HistoryVo()
|
||||
{
|
||||
super();
|
||||
init();
|
||||
}
|
||||
|
||||
public function get numAddStack() : int
|
||||
{
|
||||
var num:int = 0;
|
||||
for each(var stackvo:StackVo in Master.stacks)
|
||||
{
|
||||
if(stackvo.openType == StackOpenType.GOLD)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public function get numKeAddStack() : int
|
||||
{
|
||||
var num:int = 0;
|
||||
for each(var stackvo:StackVo in Master.stacks)
|
||||
{
|
||||
if(stackvo.openType == StackOpenType.KE)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public function get numAddRoom() : int
|
||||
{
|
||||
var num:int = 0;
|
||||
for each(var roomvo:RoomVo in Master.rooms)
|
||||
{
|
||||
if(roomvo.openType == 1)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public function get numKeAddRoom() : int
|
||||
{
|
||||
var num:int = 0;
|
||||
for each(var roomvo:RoomVo in Master.rooms)
|
||||
{
|
||||
if(roomvo.openType == 2)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public function init() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function getNumFeedMonster(type:int) : int
|
||||
{
|
||||
if(numFeedMonsters[type] == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return numFeedMonsters[type];
|
||||
}
|
||||
|
||||
public function getFeedLevel(type:int) : int
|
||||
{
|
||||
var i:int = 0;
|
||||
var num:int = getNumFeedMonster(type);
|
||||
var level:int = 0;
|
||||
var table:Object = Table.stack_info.starFeedInfo[MonsterVo.getStar(type)].levelNum;
|
||||
for(i = 0; i < table.length; )
|
||||
{
|
||||
if(num >= table[i].num)
|
||||
{
|
||||
level = int(table[i].level);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return level;
|
||||
}
|
||||
|
||||
public function getFeedExpNext(type:int) : int
|
||||
{
|
||||
var level:int = getFeedLevel(type);
|
||||
var table:Object = Table.stack_info.starFeedInfo[MonsterVo.getStar(type)].levelNum;
|
||||
if(level != 0 && table[level] == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if(level == 0)
|
||||
{
|
||||
return table[level].num;
|
||||
}
|
||||
return table[level].num - table[level - 1].num;
|
||||
}
|
||||
|
||||
public function getFeedExpCurrent(type:int) : int
|
||||
{
|
||||
var num:int = getNumFeedMonster(type);
|
||||
var level:int = getFeedLevel(type);
|
||||
var table:Object = Table.stack_info.starFeedInfo[MonsterVo.getStar(type)].levelNum;
|
||||
if(level != 0 && table[level] == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if(level == 0)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
return num - table[level - 1].num;
|
||||
}
|
||||
|
||||
public function get openRandomEvent() : Boolean
|
||||
{
|
||||
if(passTask["1001005"] != null || GameMath.ModeTrace)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get openFarmBuild() : Boolean
|
||||
{
|
||||
if(passTask["1001011"] != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get openBar() : Boolean
|
||||
{
|
||||
if(passTask["1001006"] != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get openExplore() : Boolean
|
||||
{
|
||||
if(passTask["1001008"] != null || GameMath.ModeTrace)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get openMine() : Boolean
|
||||
{
|
||||
if(passTask["10010075"] != null || GameMath.ModeTrace)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
var srtsTask:TaskVo = TaskCenter.getIns().getProcessTask("10010075");
|
||||
if(srtsTask != null && srtsTask.step >= 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get openHardMode() : Boolean
|
||||
{
|
||||
if(passTask["1001011"] != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
var srtsTask:TaskVo = TaskCenter.getIns().getProcessTask("1001011");
|
||||
if(srtsTask != null && srtsTask.step > 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get openPve() : Boolean
|
||||
{
|
||||
if(passTask["2002009"] != null || GameMath.ModeTrace)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get openKeGacha() : Boolean
|
||||
{
|
||||
if(passTask["1001006"] != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get openAlchemy() : Boolean
|
||||
{
|
||||
if(passTask["10010075"] != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get openShop() : Boolean
|
||||
{
|
||||
if(passTask["10010061"] != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
var srtsTask:TaskVo = TaskCenter.getIns().getProcessTask("10010061");
|
||||
if(srtsTask != null && srtsTask.step >= 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get openXiehuiTool() : Boolean
|
||||
{
|
||||
if(passTask["10010076"] != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function openSLMZX() : Boolean
|
||||
{
|
||||
if(passTask["1003008"] != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get openMarket() : Boolean
|
||||
{
|
||||
if(passTask["1001002"] != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function loadHistoryData(data:Object, data2:Object) : void
|
||||
{
|
||||
var j:int = 0;
|
||||
var i:int = 0;
|
||||
var i3:int = 0;
|
||||
numAddMoney = data.numAddMoney;
|
||||
numFeedMonsters = data.numFeedMonsters;
|
||||
numKillMonsters = data.numKillMonsters;
|
||||
numChicken = data.numChicken;
|
||||
countBattle = data.countBattle;
|
||||
historyGacha = data.historyGacha;
|
||||
passAchi = data.passAchi;
|
||||
passTask = data.passTask;
|
||||
unlockTask = data.unlockTask;
|
||||
for(var passTaskId:String in passTask)
|
||||
{
|
||||
if(Table.task_info[passTaskId] == null)
|
||||
{
|
||||
trace("排除",passTaskId);
|
||||
delete passTask[passTaskId];
|
||||
}
|
||||
}
|
||||
for(var unlockTaskId:String in unlockTask)
|
||||
{
|
||||
if(Table.task_info[unlockTaskId] == null)
|
||||
{
|
||||
trace("排除",unlockTaskId);
|
||||
delete unlockTask[unlockTaskId];
|
||||
}
|
||||
}
|
||||
if(data.loopTaskTime == null)
|
||||
{
|
||||
data.loopTaskTime = 0;
|
||||
}
|
||||
loopTaskTime = data.loopTaskTime / 1000;
|
||||
if(data.loopTaskNum == null)
|
||||
{
|
||||
data.loopTaskNum = 0;
|
||||
}
|
||||
loopTaskNum = data.loopTaskNum;
|
||||
for(var city:String in Table.city_info)
|
||||
{
|
||||
if(data.loopTask[city] == null)
|
||||
{
|
||||
data.loopTask[city] = [];
|
||||
}
|
||||
}
|
||||
loopTask = data.loopTask;
|
||||
if(data.guide_main == null)
|
||||
{
|
||||
guide_main = GMain.firstStory;
|
||||
}
|
||||
else
|
||||
{
|
||||
guide_main = data.guide_main;
|
||||
}
|
||||
guide_record = {};
|
||||
for(j = 0; j < data.guide_record.length; )
|
||||
{
|
||||
guide_record[data.guide_record[j]] = true;
|
||||
j++;
|
||||
}
|
||||
unlockCity = {};
|
||||
for(i = 0; i < data.unlockCity.length; )
|
||||
{
|
||||
unlockCity[data.unlockCity[i]] = true;
|
||||
i++;
|
||||
}
|
||||
unlockStage = {};
|
||||
for(var key:String in data.unlockStage)
|
||||
{
|
||||
if(key != "")
|
||||
{
|
||||
unlockStage[key] = {};
|
||||
for each(var k:int in data.unlockStage[key])
|
||||
{
|
||||
unlockStage[key][k] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
passStage = {};
|
||||
for(var stageid:String in data.passStage)
|
||||
{
|
||||
if(stageid != "")
|
||||
{
|
||||
passStage[stageid] = {};
|
||||
for each(var i2:int in data.passStage[stageid])
|
||||
{
|
||||
passStage[stageid][i2] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
guide_record = {};
|
||||
for each(var str:String in data.guide_record)
|
||||
{
|
||||
guide_record[str] = true;
|
||||
}
|
||||
monLib = data.monLib;
|
||||
equipLib = data.equipLib;
|
||||
if(Table.monster_info["3051010"] != null && Table.monster_info["3051010"].hideLib)
|
||||
{
|
||||
for(i3 = 0; i3 < equipLib.length; )
|
||||
{
|
||||
if(equipLib[i3] == 3051010)
|
||||
{
|
||||
equipLib[i3] = 3041010;
|
||||
break;
|
||||
}
|
||||
i3++;
|
||||
}
|
||||
}
|
||||
exchangeNum = {};
|
||||
if(data2 != null)
|
||||
{
|
||||
if(data2.itemExchangeInfo != null && data2.itemExchangeInfo.length > 0)
|
||||
{
|
||||
for each(var exchangevo:Object in data2.itemExchangeInfo)
|
||||
{
|
||||
exchangeNum[exchangevo.exchangeId] = exchangevo;
|
||||
}
|
||||
}
|
||||
unlockSkins = data2.unlockSkins;
|
||||
if(data2.timeEggItems == null)
|
||||
{
|
||||
timeEggItems = [];
|
||||
}
|
||||
else
|
||||
{
|
||||
timeEggItems = data2.timeEggItems;
|
||||
}
|
||||
}
|
||||
payTypeCount = data.payTypeCount;
|
||||
payTypeDayCount = data.everyDayBuyProductNum;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package net.pixvi.myr.element.master
|
||||
{
|
||||
import net.pixvi.pfw.utils.PointLocker;
|
||||
|
||||
public class MasterGlobalAdd
|
||||
{
|
||||
|
||||
public var atk:PointLocker;
|
||||
|
||||
public var def:PointLocker;
|
||||
|
||||
public var hp:PointLocker;
|
||||
|
||||
public var dex:PointLocker;
|
||||
|
||||
public function MasterGlobalAdd()
|
||||
{
|
||||
super();
|
||||
atk = new PointLocker();
|
||||
def = new PointLocker();
|
||||
hp = new PointLocker();
|
||||
dex = new PointLocker();
|
||||
}
|
||||
|
||||
public function getRecord() : Object
|
||||
{
|
||||
var o:Object = {};
|
||||
o.atk = atk.val;
|
||||
o.def = def.val;
|
||||
o.hp = hp.val;
|
||||
o.dex = dex.val;
|
||||
return o;
|
||||
}
|
||||
|
||||
public function update(globalAdd:Object) : void
|
||||
{
|
||||
if(globalAdd != null)
|
||||
{
|
||||
atk.val = globalAdd.globalAtk;
|
||||
def.val = globalAdd.globalDef;
|
||||
hp.val = globalAdd.globalHp;
|
||||
dex.val = globalAdd.globalDex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package net.pixvi.myr.element.master
|
||||
{
|
||||
public class MasterInfoVo
|
||||
{
|
||||
|
||||
public var masterId:int = 0;
|
||||
|
||||
public var createTime:Number;
|
||||
|
||||
public var roleName:String;
|
||||
|
||||
public var avatar:int;
|
||||
|
||||
public var level:int;
|
||||
|
||||
public function MasterInfoVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function loadMasterInfoData(data:Object) : void
|
||||
{
|
||||
if(data == null)
|
||||
{
|
||||
masterId = 0;
|
||||
return;
|
||||
}
|
||||
masterId = data.masterId;
|
||||
createTime = data.createTime / 1000;
|
||||
roleName = data.roleName;
|
||||
avatar = data.avatar;
|
||||
level = data.level;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,222 @@
|
||||
package net.pixvi.myr.element.master
|
||||
{
|
||||
import net.pixvi.common.driver.ClockDriver;
|
||||
import net.pixvi.common.utils.PiObject;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.center.TimeCenter;
|
||||
import net.pixvi.myr.element.bag.BagVo;
|
||||
import net.pixvi.myr.element.msg.MailBoxVo;
|
||||
import net.pixvi.myr.element.pve.PveInfoVo;
|
||||
import net.pixvi.pfw.utils.Calendar;
|
||||
import net.pixvi.pfw.utils.PointLocker;
|
||||
|
||||
public class MasterVo extends PiObject
|
||||
{
|
||||
|
||||
public var id:int;
|
||||
|
||||
public var name:String;
|
||||
|
||||
public var farmName:String;
|
||||
|
||||
public var avatar:int;
|
||||
|
||||
public var avatars:Array;
|
||||
|
||||
public var newAvatars:Array;
|
||||
|
||||
private var _level:PointLocker = new PointLocker(1);
|
||||
|
||||
private var _money:PointLocker = new PointLocker(0);
|
||||
|
||||
private var _ke:PointLocker = new PointLocker(0);
|
||||
|
||||
private var _ti:PointLocker = new PointLocker(0);
|
||||
|
||||
private var _exp:PointLocker = new PointLocker(0);
|
||||
|
||||
public var monsters:Array;
|
||||
|
||||
public var exploreTeams:Array;
|
||||
|
||||
public var builds:Array;
|
||||
|
||||
public var bag:BagVo;
|
||||
|
||||
public var stacks:Array;
|
||||
|
||||
public var teams:Array;
|
||||
|
||||
public var alchemyStacks:Array;
|
||||
|
||||
public var tasks:Array;
|
||||
|
||||
public var rooms:Array;
|
||||
|
||||
public var roomSort:Object = {};
|
||||
|
||||
public var achis:Array;
|
||||
|
||||
public var achispass:Array;
|
||||
|
||||
public var curBattleTeam:String = "teamA";
|
||||
|
||||
public var curCityId:int = 0;
|
||||
|
||||
public var history:HistoryVo;
|
||||
|
||||
public var activityHistory:ActivityHistoryVo;
|
||||
|
||||
public var mailBox:MailBoxVo;
|
||||
|
||||
public var timeTi:uint;
|
||||
|
||||
public var randomEventTimer:Object;
|
||||
|
||||
public var randomEvent:Object;
|
||||
|
||||
public var pveInfo:PveInfoVo;
|
||||
|
||||
public var globalAdd:MasterGlobalAdd;
|
||||
|
||||
public var vipTime:Number = 0;
|
||||
|
||||
public var createTime:Number;
|
||||
|
||||
public function MasterVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function get level() : int
|
||||
{
|
||||
return _level.val;
|
||||
}
|
||||
|
||||
public function set level(value:int) : void
|
||||
{
|
||||
_level.val = value;
|
||||
}
|
||||
|
||||
public function get exp() : int
|
||||
{
|
||||
return _exp.val;
|
||||
}
|
||||
|
||||
public function set exp(value:int) : void
|
||||
{
|
||||
_exp.val = value;
|
||||
}
|
||||
|
||||
public function get ti() : int
|
||||
{
|
||||
return _ti.val;
|
||||
}
|
||||
|
||||
public function set ti(value:int) : void
|
||||
{
|
||||
_ti.val = value;
|
||||
}
|
||||
|
||||
public function get ke() : int
|
||||
{
|
||||
return _ke.val;
|
||||
}
|
||||
|
||||
public function set ke(value:int) : void
|
||||
{
|
||||
_ke.val = value;
|
||||
}
|
||||
|
||||
public function init() : void
|
||||
{
|
||||
history = new HistoryVo();
|
||||
activityHistory = new ActivityHistoryVo();
|
||||
mailBox = new MailBoxVo();
|
||||
bag = new BagVo();
|
||||
level = 1;
|
||||
curCityId = 0;
|
||||
money = 0;
|
||||
rooms = [];
|
||||
ke = 0;
|
||||
ti = tiMax;
|
||||
exp = 0;
|
||||
monsters = [];
|
||||
stacks = [];
|
||||
teams = [];
|
||||
alchemyStacks = [];
|
||||
tasks = [];
|
||||
achis = [];
|
||||
achispass = [];
|
||||
exploreTeams = [];
|
||||
timeTi = ClockDriver.timestamp;
|
||||
globalAdd = new MasterGlobalAdd();
|
||||
randomEvent = {};
|
||||
randomEventTimer = {};
|
||||
}
|
||||
|
||||
public function canLevelUp() : Boolean
|
||||
{
|
||||
if(exp >= nextExp())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function nextExp() : int
|
||||
{
|
||||
return Table.farm_level[this.level + 1];
|
||||
}
|
||||
|
||||
public function get ap() : int
|
||||
{
|
||||
return GameMath.apByLevel(level);
|
||||
}
|
||||
|
||||
public function get tiMax() : int
|
||||
{
|
||||
return GameMath.tiMaxByLevel(level);
|
||||
}
|
||||
|
||||
public function get money() : int
|
||||
{
|
||||
return _money.val;
|
||||
}
|
||||
|
||||
public function set money(value:int) : void
|
||||
{
|
||||
_money.val = value;
|
||||
}
|
||||
|
||||
public function get showExp() : int
|
||||
{
|
||||
return exp - Table.farm_level[level];
|
||||
}
|
||||
|
||||
public function get showNextExp() : int
|
||||
{
|
||||
if(level <= GameMath.masterMaxLevel)
|
||||
{
|
||||
return Table.farm_level[level + 1] - Table.farm_level[level];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function get passDay() : int
|
||||
{
|
||||
return 1 + Calendar.getDayNumber(TimeCenter.timestamp * 1000) - Calendar.getDayNumber(Master.createTime);
|
||||
}
|
||||
|
||||
public function getRecords() : Object
|
||||
{
|
||||
var obj:Object = {};
|
||||
obj.level = level;
|
||||
obj.globalAdd = globalAdd.getRecord();
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user