Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,107 @@
|
||||
package net.pixvi.myr.element.achi
|
||||
{
|
||||
public class AchiType
|
||||
{
|
||||
|
||||
public static var HUNTER:String = "hunter";
|
||||
|
||||
public static var FEED:String = "feed";
|
||||
|
||||
public static var COLLECTION:String = "collection";
|
||||
|
||||
public static var LIB:String = "lib";
|
||||
|
||||
public static var EQUIP:String = "equipLib";
|
||||
|
||||
public static var STAGE:String = "stage";
|
||||
|
||||
public static var STARS:String = "stars";
|
||||
|
||||
public static var MONEY:String = "money";
|
||||
|
||||
public static var PULL_MENU:String = "pullMenu";
|
||||
|
||||
public static var LEVEL:String = "level";
|
||||
|
||||
public static var STAGE_LEVELS:String = "stageLevel";
|
||||
|
||||
public static var ENTANGLE:String = "entangle";
|
||||
|
||||
public static var ITEM:String = "item";
|
||||
|
||||
public static var NONE:String = "none";
|
||||
|
||||
public static var SKIN:String = "skin";
|
||||
|
||||
public static var CHECK_DAY:String = "check";
|
||||
|
||||
public static var CHECK_DAY_TOTAL:String = "checkTotal";
|
||||
|
||||
public static var achiTypeObject:Object = {
|
||||
"hunter":{
|
||||
"type":1001001,
|
||||
"num":100
|
||||
},
|
||||
"feed":{
|
||||
"type":1001001,
|
||||
"num":10
|
||||
},
|
||||
"collection":{"types":[1001001,2002001]},
|
||||
"stage":{
|
||||
"stage":"0101",
|
||||
"level":"1"
|
||||
},
|
||||
"stars":{
|
||||
"num":5,
|
||||
"city":1
|
||||
},
|
||||
"money":{"num":1000},
|
||||
"pullMenu":{"num":50},
|
||||
"battleCount":{"num":50},
|
||||
"lib":{"num":10},
|
||||
"equipLib":{"num":10},
|
||||
"level":{"level":10},
|
||||
"stageLevel":{"stageLevels":{"0101":["2","3"]}},
|
||||
"entangle":{
|
||||
"num":1,
|
||||
"star":"12345",
|
||||
"level":"1"
|
||||
},
|
||||
"item":{
|
||||
"itemType":"10001",
|
||||
"num":"1"
|
||||
},
|
||||
"none":{"passGuide":""},
|
||||
"skin":{"num":10},
|
||||
"check":{"num":10},
|
||||
"checkTotal":{"num":100}
|
||||
};
|
||||
|
||||
public static var achiTypeDes:Object = {
|
||||
"hunter":{"des":"狩猎{type}魔物{num}只"},
|
||||
"feed":{"des":"养成{type}成年魔物{num}只"},
|
||||
"collection":{"des":"图鉴解锁目标全部魔物{types[...]}"},
|
||||
"stage":{"des":"通过关卡{stage}的{level}难度探索"},
|
||||
"stars":{"des":"累积获得{city}区域的关卡星星{num}个"},
|
||||
"money":{"des":"累积赚取{num}金币"},
|
||||
"pullMenu":{"des":"玩弄背包挂件{num}次"},
|
||||
"battleCount":{"des":"累积进行了战斗{num}次"},
|
||||
"lib":{"des":"总解锁的魔物图鉴数量{num}"},
|
||||
"equipLib":{"des":"总解锁的装备图鉴数量{num}"},
|
||||
"level":{"des":"当角色达到{level}级时可完成成就"},
|
||||
"stageLevel":{"des":"当通过制定关卡的指定难度时,完成成就"},
|
||||
"entangle":{"des":"{star}星级范围的魔物累计达到或超过{level}羁绊{num}只,成就完成"},
|
||||
"item":{"des":"拥有类型{itemType}道具{num}个时,完成成就"},
|
||||
"none":{"des":"完成指引{guidePass}时可完成成就"},
|
||||
"skin":{"des":"收集到{num}个皮肤时完成"},
|
||||
"check":{"des":"连续获得补给{num}天时完成"},
|
||||
"checkTotal":{"des":"累计获得补给{num}天时完成"}
|
||||
};
|
||||
|
||||
public function AchiType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,324 @@
|
||||
package net.pixvi.myr.element.achi
|
||||
{
|
||||
import net.pixvi.common.utils.PiObject;
|
||||
import net.pixvi.myr.center.BagCenter;
|
||||
import net.pixvi.myr.center.GuideCenter;
|
||||
import net.pixvi.myr.center.LibCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.StageCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.element.reward.RewardVo;
|
||||
import net.pixvi.pfw.utils.ArrayUtil;
|
||||
|
||||
public class AchiVo extends PiObject
|
||||
{
|
||||
|
||||
public var id:int;
|
||||
|
||||
public var isComplete:Boolean = false;
|
||||
|
||||
public var showComplete:Boolean = false;
|
||||
|
||||
public function AchiVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(id:int) : void
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public function get next() : Array
|
||||
{
|
||||
return table().next;
|
||||
}
|
||||
|
||||
public function get name() : String
|
||||
{
|
||||
return table().name;
|
||||
}
|
||||
|
||||
public function get des() : String
|
||||
{
|
||||
return table().des;
|
||||
}
|
||||
|
||||
public function get reward() : Object
|
||||
{
|
||||
return table().reward;
|
||||
}
|
||||
|
||||
public function get closed() : Boolean
|
||||
{
|
||||
if(table().closed == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return table().closed;
|
||||
}
|
||||
|
||||
public function get rewardvo() : RewardVo
|
||||
{
|
||||
var r:RewardVo = new RewardVo();
|
||||
r.setByObject(reward);
|
||||
return r;
|
||||
}
|
||||
|
||||
public function get desOfProcess() : String
|
||||
{
|
||||
var stars:String = null;
|
||||
var num:int = 0;
|
||||
var cur:* = 0;
|
||||
var target:int = 0;
|
||||
switch(type)
|
||||
{
|
||||
case AchiType.COLLECTION:
|
||||
cur = LibCenter.getIns().getNumUnlockByMonTypes(ArrayUtil.split(achiPara.types,",",true));
|
||||
target = int(achiPara.types.length);
|
||||
break;
|
||||
case AchiType.FEED:
|
||||
if(Master.history.numFeedMonsters[achiPara.type] == null)
|
||||
{
|
||||
Master.history.numFeedMonsters[achiPara.type] = 0;
|
||||
}
|
||||
cur = int(Master.history.numFeedMonsters[achiPara.type]);
|
||||
target = int(achiPara.num);
|
||||
break;
|
||||
case AchiType.SKIN:
|
||||
if(Master.history.unlockSkins == null)
|
||||
{
|
||||
cur = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
cur = int(Master.history.unlockSkins.length);
|
||||
}
|
||||
target = int(achiPara.num);
|
||||
break;
|
||||
case AchiType.HUNTER:
|
||||
if(Master.history.numKillMonsters[achiPara.type] == null)
|
||||
{
|
||||
Master.history.numKillMonsters[achiPara.type] = 0;
|
||||
}
|
||||
cur = int(Master.history.numKillMonsters[achiPara.type]);
|
||||
target = int(achiPara.num);
|
||||
break;
|
||||
case AchiType.MONEY:
|
||||
cur = int(Master.history.numAddMoney);
|
||||
target = int(achiPara.num);
|
||||
break;
|
||||
case AchiType.STAGE:
|
||||
cur = 0;
|
||||
target = 1;
|
||||
break;
|
||||
case AchiType.STARS:
|
||||
cur = StageCenter.getIns().countStars();
|
||||
target = int(achiPara.num);
|
||||
break;
|
||||
case AchiType.PULL_MENU:
|
||||
cur = int(Master.history.pullMenu);
|
||||
target = int(achiPara.num);
|
||||
break;
|
||||
case AchiType.ENTANGLE:
|
||||
stars = achiPara.star;
|
||||
num = 0;
|
||||
for each(var m:MonsterVo in Master.monsters)
|
||||
{
|
||||
if(m.entangle && stars.indexOf(m.star.toString()) >= 0)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
cur = num;
|
||||
target = int(achiPara.num);
|
||||
break;
|
||||
case AchiType.LEVEL:
|
||||
cur = int(Master.level);
|
||||
target = int(achiPara.level);
|
||||
break;
|
||||
case AchiType.ITEM:
|
||||
cur = BagCenter.getIns().getNum(achiPara.itemType);
|
||||
target = int(achiPara.num);
|
||||
break;
|
||||
case AchiType.STAGE_LEVELS:
|
||||
target = 0;
|
||||
cur = 0;
|
||||
for(var key:String in achiPara.stageLevels)
|
||||
{
|
||||
for each(var slv:String in achiPara.stageLevels[key])
|
||||
{
|
||||
if(StageCenter.getIns().isStagePass(key,int(slv)))
|
||||
{
|
||||
cur++;
|
||||
}
|
||||
target++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return cur + "/" + target;
|
||||
}
|
||||
|
||||
public function get achiPara() : Object
|
||||
{
|
||||
return table().achiPara;
|
||||
}
|
||||
|
||||
public function get achiType() : String
|
||||
{
|
||||
return table().achiType;
|
||||
}
|
||||
|
||||
public function get achiTag() : String
|
||||
{
|
||||
return table().tag;
|
||||
}
|
||||
|
||||
public function get type() : String
|
||||
{
|
||||
return table().achiType;
|
||||
}
|
||||
|
||||
public function get hide() : Boolean
|
||||
{
|
||||
return table().hide;
|
||||
}
|
||||
|
||||
public function table() : Object
|
||||
{
|
||||
return Table.achi_info[id];
|
||||
}
|
||||
|
||||
public function canFinish() : Boolean
|
||||
{
|
||||
var cur:int = 0;
|
||||
var target:int = 0;
|
||||
var stars:String = null;
|
||||
var num:int = 0;
|
||||
var itemnum:int = 0;
|
||||
var daynum:int = 0;
|
||||
daynum = 0;
|
||||
switch(type)
|
||||
{
|
||||
case AchiType.COLLECTION:
|
||||
return LibCenter.getIns().checkUnlocks(ArrayUtil.split(achiPara.types));
|
||||
case AchiType.FEED:
|
||||
if(Master.history.numFeedMonsters[achiPara.type] == null)
|
||||
{
|
||||
Master.history.numFeedMonsters[achiPara.type] = 0;
|
||||
}
|
||||
return Master.history.numFeedMonsters[achiPara.type] >= achiPara.num;
|
||||
case AchiType.HUNTER:
|
||||
if(Master.history.numKillMonsters[achiPara.type] == null)
|
||||
{
|
||||
Master.history.numKillMonsters[achiPara.type] = 0;
|
||||
}
|
||||
return Master.history.numKillMonsters[achiPara.type] >= achiPara.num;
|
||||
case AchiType.MONEY:
|
||||
return Master.history.numAddMoney >= achiPara.num;
|
||||
case AchiType.STAGE:
|
||||
if(Master.history.passStage[achiPara.stage] == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(Master.history.passStage[achiPara.stage][1] == true)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case AchiType.STARS:
|
||||
return StageCenter.getIns().countStars() >= achiPara.num;
|
||||
case AchiType.PULL_MENU:
|
||||
return Master.history.pullMenu >= achiPara.num;
|
||||
case AchiType.LEVEL:
|
||||
return Master.level >= achiPara.level;
|
||||
case AchiType.STAGE_LEVELS:
|
||||
loop0:
|
||||
for(var key:String in achiPara.stageLevels)
|
||||
{
|
||||
var _loc11_:int = 0;
|
||||
var _loc10_:* = achiPara.stageLevels[key];
|
||||
do
|
||||
{
|
||||
for each(var slv:String in _loc10_)
|
||||
{
|
||||
}
|
||||
continue loop0;
|
||||
}
|
||||
while(StageCenter.getIns().isStagePass(key,int(slv)));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
case AchiType.SKIN:
|
||||
cur = 0;
|
||||
if(Master.history.unlockSkins == null)
|
||||
{
|
||||
cur = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
cur = int(Master.history.unlockSkins.length);
|
||||
}
|
||||
target = int(achiPara.num);
|
||||
if(target <= cur)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case AchiType.ENTANGLE:
|
||||
stars = achiPara.star;
|
||||
num = 0;
|
||||
for each(var m:MonsterVo in Master.monsters)
|
||||
{
|
||||
if(m.entangle && m.entangleLevel >= int(achiPara.level) && stars.indexOf(m.star.toString()) >= 0)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
if(num >= achiPara.num)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case AchiType.ITEM:
|
||||
itemnum = BagCenter.getIns().getNum(achiPara.itemType);
|
||||
if(itemnum >= achiPara.num)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case AchiType.CHECK_DAY:
|
||||
daynum = int(Master.activityHistory.dailyGiftCount);
|
||||
if(daynum >= achiPara.num)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case AchiType.CHECK_DAY:
|
||||
daynum = int(Master.activityHistory.dailyGiftSignCount);
|
||||
if(daynum >= achiPara.num)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case AchiType.NONE:
|
||||
if(achiPara.passGuide != null)
|
||||
{
|
||||
return GuideCenter.getIns().checkFin(achiPara.passGuide);
|
||||
}
|
||||
return true;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user