Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
package net.pixvi.myr.element
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
|
||||
public class MonsterElement
|
||||
{
|
||||
|
||||
public static var elementNameDic:Object = {
|
||||
"1":"水",
|
||||
"2":"火",
|
||||
"3":"地",
|
||||
"4":"风",
|
||||
"5":"无"
|
||||
};
|
||||
|
||||
public static var elementDesDic:Object = {
|
||||
"1":"水属性<br/>克制火属性<br/>被地属性克制",
|
||||
"2":"火属性<br/>克制风属性<br/>被水属性克制",
|
||||
"3":"地属性<br/>克制水属性<br/>被风属性克制",
|
||||
"4":"风属性<br/>克制地属性<br/>被火属性克制",
|
||||
"5":"不克制任何属性<br/>不被任何属性克制"
|
||||
};
|
||||
|
||||
public static var elementBossDes:Object = {
|
||||
"1":"【地属性伤害+15%】",
|
||||
"2":"【水属性伤害+15%】",
|
||||
"3":"【风属性伤害+15%】",
|
||||
"4":"【火属性伤害+15%】"
|
||||
};
|
||||
|
||||
public function MonsterElement()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getElementName(element:int) : String
|
||||
{
|
||||
return lang(elementNameDic[element]);
|
||||
}
|
||||
|
||||
public static function getElementTip(element:int) : String
|
||||
{
|
||||
return lang(elementDesDic[element]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package net.pixvi.myr.element
|
||||
{
|
||||
import net.pixvi.common.utils.PiObject;
|
||||
|
||||
public class SettingVo extends PiObject
|
||||
{
|
||||
|
||||
public var quality:int = 3;
|
||||
|
||||
public var openBgm:Boolean = true;
|
||||
|
||||
public var openEffect:Boolean = true;
|
||||
|
||||
public var liuhaiMode:Boolean = false;
|
||||
|
||||
public var openVocal:Boolean = true;
|
||||
|
||||
public var quickSkill:Boolean = true;
|
||||
|
||||
public var globalVolume:Number = 1;
|
||||
|
||||
public function SettingVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
package net.pixvi.myr.element.alchemy
|
||||
{
|
||||
import net.pixvi.common.utils.PiObject;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.center.AlchemyCenter;
|
||||
import net.pixvi.myr.center.TimeCenter;
|
||||
|
||||
public class AlchemyStackVo extends PiObject
|
||||
{
|
||||
|
||||
public var id:int;
|
||||
|
||||
public var endTime:int;
|
||||
|
||||
public var itemTypes:Array = [];
|
||||
|
||||
public var starting:Boolean = false;
|
||||
|
||||
private var _formulaLevel:int = -1;
|
||||
|
||||
public function AlchemyStackVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function finish() : Boolean
|
||||
{
|
||||
if(leftTime() == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function leftTime() : int
|
||||
{
|
||||
var time:int = endTime - TimeCenter.timestamp;
|
||||
if(time < 0)
|
||||
{
|
||||
time = 0;
|
||||
}
|
||||
return time;
|
||||
}
|
||||
|
||||
public function curFormulaLevelInfo() : Object
|
||||
{
|
||||
return GameMath.alchemyFormulaCost[formulaLevel.toString()];
|
||||
}
|
||||
|
||||
public function checkFormula() : Boolean
|
||||
{
|
||||
return AlchemyCenter.getIns().checkAlchemyFormula(itemTypes);
|
||||
}
|
||||
|
||||
public function get formulaLevel() : int
|
||||
{
|
||||
if(_formulaLevel == -1)
|
||||
{
|
||||
_formulaLevel = AlchemyCenter.getIns().getFormulaLevel(itemTypes);
|
||||
}
|
||||
return _formulaLevel;
|
||||
}
|
||||
|
||||
public function process() : Number
|
||||
{
|
||||
return 1 - leftTime() / curFormulaLevelInfo().time;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package net.pixvi.myr.element.alchemy
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
|
||||
public class EquipType
|
||||
{
|
||||
|
||||
public static var _partNameDic:Object;
|
||||
|
||||
public function EquipType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function get partNameDic() : Object
|
||||
{
|
||||
if(_partNameDic == null)
|
||||
{
|
||||
_partNameDic = {
|
||||
"1":lang("武器"),
|
||||
"2":lang("防具"),
|
||||
"3":lang("饰品"),
|
||||
"4":lang("头部装饰"),
|
||||
"5":lang("身体装饰")
|
||||
};
|
||||
}
|
||||
return _partNameDic;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package net.pixvi.myr.element.alchemy
|
||||
{
|
||||
import net.pixvi.myr.center.Table;
|
||||
|
||||
public class MaterialType
|
||||
{
|
||||
|
||||
public function MaterialType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function get materialDic() : Object
|
||||
{
|
||||
return Table.setting.materialDic;
|
||||
}
|
||||
|
||||
public static function getMaterialsTip(types:Array) : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var o2:Object = null;
|
||||
var materials:Array = [];
|
||||
var allmat:Object = {};
|
||||
for each(var type:int in types)
|
||||
{
|
||||
for each(var o:Object in Table.item_info[type].material)
|
||||
{
|
||||
if(allmat[o.name] == null)
|
||||
{
|
||||
allmat[o.name] = 0;
|
||||
}
|
||||
var _loc10_:* = o.name;
|
||||
var _loc11_:Number = allmat[_loc10_] + int(o.value);
|
||||
allmat[_loc10_] = _loc11_;
|
||||
}
|
||||
}
|
||||
for(var key:String in allmat)
|
||||
{
|
||||
materials.push({
|
||||
"name":key,
|
||||
"value":int(allmat[key])
|
||||
});
|
||||
}
|
||||
materials.sortOn("value",2 | 0x10);
|
||||
var final:Array = [];
|
||||
for(i = 0; i < materials.length; )
|
||||
{
|
||||
o2 = materials[i];
|
||||
final.push(materialDic[o2.name] + "×" + o2.value);
|
||||
i++;
|
||||
}
|
||||
return final;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
package net.pixvi.myr.element.bag
|
||||
{
|
||||
import net.pixvi.common.utils.PiObject;
|
||||
|
||||
public class BagVo extends PiObject
|
||||
{
|
||||
|
||||
public var items:Array = [];
|
||||
|
||||
public var level:int = 1;
|
||||
|
||||
public function BagVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function sellableItems() : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var arr:Array = [];
|
||||
for(i = 0; i < items.length; )
|
||||
{
|
||||
if(items[i].itemType != ItemType.TYPE_EQUIP && items[i].itemType != ItemType.TYPE_EGG && items[i].sellable)
|
||||
{
|
||||
arr.push(items[i]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
public function alchemyMaterialItems() : Array
|
||||
{
|
||||
var vo:ItemVo = null;
|
||||
var i:int = 0;
|
||||
var arr:Array = [];
|
||||
var equip:Array = [];
|
||||
for(i = 0; i < items.length; )
|
||||
{
|
||||
vo = items[i];
|
||||
if(vo.itemType == ItemType.TYPE_MATERIAL)
|
||||
{
|
||||
if(vo.sellable && vo.showNum > 0)
|
||||
{
|
||||
arr.push(items[i]);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
public function removeItem(id:Number) : ItemVo
|
||||
{
|
||||
var i:int = 0;
|
||||
for(i = 0; i < items.length; )
|
||||
{
|
||||
if(items[i].id == id)
|
||||
{
|
||||
return items.splice(i,1)[0];
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function isFull() : Boolean
|
||||
{
|
||||
if(items.length >= getSpace())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getSpace() : int
|
||||
{
|
||||
return 1000;
|
||||
}
|
||||
|
||||
public function getItemArr() : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var arr:Array = [];
|
||||
for(i = 0; i < items.length; )
|
||||
{
|
||||
if(items[i].itemType != ItemType.TYPE_EQUIP && items[i].itemType != ItemType.TYPE_EGG)
|
||||
{
|
||||
arr.push(items[i]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
public function getItemArrUseable() : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var arr:Array = [];
|
||||
for(i = 0; i < items.length; )
|
||||
{
|
||||
if(items[i].itemType != ItemType.TYPE_EQUIP && items[i].itemType != ItemType.TYPE_EGG && items[i].useable)
|
||||
{
|
||||
arr.push(items[i]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
public function getItemArrQuality(quality:int) : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var arr:Array = [];
|
||||
for(i = 0; i < items.length; )
|
||||
{
|
||||
if(items[i].itemType != ItemType.TYPE_EQUIP && items[i].itemType != ItemType.TYPE_EGG && items[i].quality == quality)
|
||||
{
|
||||
arr.push(items[i]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
public function getEquipArr(part:int = -1, quality:int = 0) : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var arr:Array = [];
|
||||
for(i = 0; i < items.length; )
|
||||
{
|
||||
if(items[i].itemType == ItemType.TYPE_EQUIP && !items[i].isUsed && (part == -1 || items[i].part == part) && (quality == 0 || items[i].quality == quality))
|
||||
{
|
||||
arr.push(items[i]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
public function getEggArr() : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var arr:Array = [];
|
||||
for(i = 0; i < items.length; )
|
||||
{
|
||||
if(items[i].itemType == ItemType.TYPE_EGG)
|
||||
{
|
||||
arr.push(items[i]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package net.pixvi.myr.element.bag
|
||||
{
|
||||
public class BuildMaterialVo
|
||||
{
|
||||
|
||||
public var cores:Object;
|
||||
|
||||
public var materials:Object;
|
||||
|
||||
public function BuildMaterialVo()
|
||||
{
|
||||
super();
|
||||
cores = {};
|
||||
materials = {};
|
||||
}
|
||||
|
||||
public function buildByItemVoArr(items:Array) : void
|
||||
{
|
||||
var j:int = 0;
|
||||
for each(var item:ItemVo in items)
|
||||
{
|
||||
if(cores[item.type] == null)
|
||||
{
|
||||
cores[item.type] = 0;
|
||||
}
|
||||
cores[item.type]++;
|
||||
for(j = 0; j < item.material.length; )
|
||||
{
|
||||
if(materials[item.material[j].name] == null)
|
||||
{
|
||||
materials[item.material[j].name] = 0;
|
||||
}
|
||||
var _loc4_:* = item.material[j].name;
|
||||
var _loc5_:Number = materials[_loc4_] + int(item.material[j].value);
|
||||
materials[_loc4_] = _loc5_;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package net.pixvi.myr.element.bag
|
||||
{
|
||||
public class EquipBuildVo
|
||||
{
|
||||
|
||||
public var type:int;
|
||||
|
||||
public var material:Array;
|
||||
|
||||
public var core:Array;
|
||||
|
||||
public var chance:int;
|
||||
|
||||
public function EquipBuildVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function check(buildMaterialVo:BuildMaterialVo) : Boolean
|
||||
{
|
||||
var i:int = 0;
|
||||
var j:int = 0;
|
||||
for(i = 0; i < core.length; )
|
||||
{
|
||||
if(buildMaterialVo.cores[core[i].name] == null || buildMaterialVo.cores[core[i].name] < core[i].value)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
for(j = 0; j < material.length; )
|
||||
{
|
||||
if(buildMaterialVo.materials[material[j].name] == null || buildMaterialVo.materials[material[j].name] < material[j].value)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
package net.pixvi.myr.element.bag
|
||||
{
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
|
||||
public class EquipLimitVo
|
||||
{
|
||||
|
||||
public var type:int = 0;
|
||||
|
||||
public var element:int = 0;
|
||||
|
||||
public var group:int = 0;
|
||||
|
||||
public function EquipLimitVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function onData(data:Object) : void
|
||||
{
|
||||
if(data.type != null)
|
||||
{
|
||||
type = data.type;
|
||||
}
|
||||
if(data.element != null)
|
||||
{
|
||||
element = data.element;
|
||||
}
|
||||
if(data.group != null)
|
||||
{
|
||||
group = data.group;
|
||||
}
|
||||
}
|
||||
|
||||
public function hasLimit() : Boolean
|
||||
{
|
||||
if(type == 0 && element == 0 && group == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function check(vo:MonsterVo) : Boolean
|
||||
{
|
||||
if(type != 0 && type != vo.type)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(element != 0 && element != vo.element)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(group != 0 && group != vo.group)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getDes() : String
|
||||
{
|
||||
var des:String = "";
|
||||
if(type != 0)
|
||||
{
|
||||
des = MonsterVo.getName(type) + " 专属";
|
||||
}
|
||||
else if(element != 0)
|
||||
{
|
||||
des = "属性限定:" + Table.monster_setting.element[element].name;
|
||||
}
|
||||
else if(group != 0)
|
||||
{
|
||||
des = "物种限定:" + Table.monster_setting.group[group].name;
|
||||
}
|
||||
return des;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,305 @@
|
||||
package net.pixvi.myr.element.bag
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.alchemy.EquipType;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.pfw.utils.PointLocker;
|
||||
import net.pixvi.pfw.utils.Saver;
|
||||
|
||||
public class EquipVo extends ItemVo
|
||||
{
|
||||
|
||||
public static var EQUIP_PARAS:Array = ["atk","def","hp","dex","crit","atkSpd","atkVim","selfCure","apCostSave","deadBoom","atkStun","defStun","atkPoi","atkPoiDmg","skillCooldown","sunFire","moonHeal","thorns"];
|
||||
|
||||
public var isUsed:Boolean = false;
|
||||
|
||||
public var atk:PointLocker;
|
||||
|
||||
public var def:PointLocker;
|
||||
|
||||
public var hp:PointLocker;
|
||||
|
||||
public var dex:PointLocker;
|
||||
|
||||
public var crit:PointLocker;
|
||||
|
||||
public var atkSpd:PointLocker;
|
||||
|
||||
public var atkVim:PointLocker;
|
||||
|
||||
public var selfCure:PointLocker;
|
||||
|
||||
public var deadBoom:PointLocker;
|
||||
|
||||
public var atkStun:PointLocker;
|
||||
|
||||
public var atkStunTime:PointLocker;
|
||||
|
||||
public var atkStunType:int = 1;
|
||||
|
||||
public var defStun:PointLocker;
|
||||
|
||||
public var defStunTime:PointLocker;
|
||||
|
||||
public var defStunType:int = 1;
|
||||
|
||||
public var atkPoi:PointLocker;
|
||||
|
||||
public var atkPoiDmg:PointLocker;
|
||||
|
||||
public var atkPoiType:int = 1;
|
||||
|
||||
public var apCostSave:PointLocker;
|
||||
|
||||
public var skillCooldown:PointLocker;
|
||||
|
||||
public var sunFire:PointLocker;
|
||||
|
||||
public var moonHeal:PointLocker;
|
||||
|
||||
public var thorns:PointLocker;
|
||||
|
||||
private var limit:EquipLimitVo;
|
||||
|
||||
public function EquipVo()
|
||||
{
|
||||
super();
|
||||
atk = new PointLocker();
|
||||
def = new PointLocker();
|
||||
hp = new PointLocker();
|
||||
dex = new PointLocker();
|
||||
crit = new PointLocker();
|
||||
atkSpd = new PointLocker();
|
||||
atkVim = new PointLocker();
|
||||
selfCure = new PointLocker();
|
||||
deadBoom = new PointLocker();
|
||||
atkStun = new PointLocker();
|
||||
atkStunTime = new PointLocker();
|
||||
defStun = new PointLocker();
|
||||
defStunTime = new PointLocker();
|
||||
atkPoi = new PointLocker();
|
||||
atkPoiDmg = new PointLocker();
|
||||
apCostSave = new PointLocker();
|
||||
skillCooldown = new PointLocker();
|
||||
sunFire = new PointLocker();
|
||||
moonHeal = new PointLocker();
|
||||
thorns = new PointLocker();
|
||||
num = 1;
|
||||
}
|
||||
|
||||
public static function getAbilityEffectDes(obj:Object, paraNameMode:Boolean = false) : Array
|
||||
{
|
||||
var s:Array = [];
|
||||
var paraName:Array = [];
|
||||
if(obj.spWord != null && Table.monster_setting.spWordDes[obj.spWord] != null)
|
||||
{
|
||||
paraName.push(Table.monster_setting.spWordDes[obj.spWord]);
|
||||
s.push(Paster.font(Table.monster_setting.spWordDes[obj.spWord],"#ff3300"));
|
||||
}
|
||||
if(obj.atk.val > 0)
|
||||
{
|
||||
paraName.push(lang("攻击"));
|
||||
s.push(lang("攻击") + "+" + Math.round(obj.atk.val).toString());
|
||||
}
|
||||
if(obj.def.val > 0)
|
||||
{
|
||||
paraName.push(lang("防御"));
|
||||
s.push(lang("防御") + "+" + Math.round(obj.def.val).toString());
|
||||
}
|
||||
if(obj.hp.val > 0)
|
||||
{
|
||||
paraName.push(lang("生命"));
|
||||
s.push(lang("生命") + "+" + Math.round(obj.hp.val).toString());
|
||||
}
|
||||
if(obj.dex.val > 0)
|
||||
{
|
||||
paraName.push(lang("敏捷"));
|
||||
s.push(lang("敏捷") + "+" + Math.round(obj.dex.val).toString());
|
||||
}
|
||||
if(obj.crit.val > 0)
|
||||
{
|
||||
paraName.push(lang("暴击"));
|
||||
s.push(lang("暴击") + "+" + Math.round(obj.crit.val).toString() + "%");
|
||||
}
|
||||
if(obj.atkSpd.val > 0)
|
||||
{
|
||||
paraName.push(lang("攻速"));
|
||||
s.push(lang("攻速") + "+" + Math.round(obj.atkSpd.val).toString() + "%");
|
||||
}
|
||||
if(obj.skillCooldown.val > 0)
|
||||
{
|
||||
paraName.push(lang("冷却时间"));
|
||||
s.push(lang("冷却时间") + "-" + Math.round(obj.skillCooldown.val).toString() + "%");
|
||||
}
|
||||
if(obj.apCostSave.val > 0)
|
||||
{
|
||||
paraName.push(lang("移动消耗"));
|
||||
s.push(lang("移动消耗") + "-" + obj.apCostSave.val);
|
||||
}
|
||||
if(obj.thorns.val > 0)
|
||||
{
|
||||
paraName.push(lang("反伤"));
|
||||
s.push(lang("反伤") + obj.thorns.val + "%");
|
||||
}
|
||||
if(obj.selfCure.val > 0)
|
||||
{
|
||||
paraName.push(lang("自愈"));
|
||||
s.push(Paster.font(lang("自愈") + Math.round(obj.selfCure.val).toString(),"#ff66ff"));
|
||||
}
|
||||
if(obj.atkVim.val > 0)
|
||||
{
|
||||
paraName.push("吸血");
|
||||
s.push(Paster.font("吸血" + Math.round(obj.atkVim.val).toString() + "%","#ff66ff"));
|
||||
}
|
||||
if(obj.deadBoom.val > 0)
|
||||
{
|
||||
paraName.push("自爆");
|
||||
s.push(Paster.font("自爆" + Math.round(obj.deadBoom.val).toString(),"#ff66ff"));
|
||||
}
|
||||
if(obj.atkPoi.val > 0)
|
||||
{
|
||||
paraName.push(obj.atkPoiType == 1 ? lang("中毒") : lang("流血"));
|
||||
s.push(Paster.font((obj.atkPoiType == 1 ? lang("中毒") : lang("流血")) + Math.round(obj.atkPoi.val).toString() + "%(" + obj.atkPoiDmg.val + "/s)","#ff66ff"));
|
||||
}
|
||||
if(obj.atkStun.val > 0)
|
||||
{
|
||||
paraName.push(obj.atkStunType == 1 ? lang("攻击眩晕") : lang("攻击冰冻"));
|
||||
s.push(Paster.font((obj.atkStunType == 1 ? lang("攻击眩晕") : lang("攻击冰冻")) + Math.round(obj.atkStun.val).toString() + "%(" + obj.atkStunTime.val + "s)","#ff66ff"));
|
||||
}
|
||||
if(obj.defStun.val > 0)
|
||||
{
|
||||
paraName.push(obj.defStunType == 1 ? lang("反击眩晕") : lang("反击冰冻"));
|
||||
s.push(Paster.font((obj.defStunType == 1 ? lang("反击眩晕") : lang("反击冰冻")) + Math.round(obj.defStun.val).toString() + "%(" + obj.defStunTime.val + "s)","#ff66ff"));
|
||||
}
|
||||
if(obj.sunFire.val > 0)
|
||||
{
|
||||
paraName.push(lang("灼烧光环"));
|
||||
s.push(Paster.font(lang("灼烧光环") + Math.round(obj.sunFire.val).toString(),"#ff66ff"));
|
||||
}
|
||||
if(obj.moonHeal.val > 0)
|
||||
{
|
||||
paraName.push(lang("治疗光环"));
|
||||
s.push(Paster.font(lang("治疗光环") + Math.round(obj.moonHeal.val).toString(),"#ff66ff"));
|
||||
}
|
||||
if(paraNameMode)
|
||||
{
|
||||
return paraName;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
public function get hideo() : Boolean
|
||||
{
|
||||
return Saver.getAuto(id + "hideo");
|
||||
}
|
||||
|
||||
public function set hideo(val:Boolean) : void
|
||||
{
|
||||
return Saver.saveAuto(id + "hideo",val);
|
||||
}
|
||||
|
||||
public function get buildMaterial() : Array
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public function get buildCore() : Array
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public function get chance() : int
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public function get effectMovs() : Array
|
||||
{
|
||||
return table().effectMovs;
|
||||
}
|
||||
|
||||
public function buildAuto(float:Number = 0) : void
|
||||
{
|
||||
var ranPara:Array = ["atk","def","hp","dex","crit","atkSpd","atkVim","selfCure","deadBoom","atkStun","defStun","atkPoi","atkPoiDmg","skillCooldown","sunFire","moonHeal","thorns"];
|
||||
var staticPara:Array = ["atkStunTime","atkStunType","defStunTime","defStunType","atkPoiType","apCostSave"];
|
||||
for each(var k:String in ranPara)
|
||||
{
|
||||
this[k].val = (1 + float) * getTable()[k];
|
||||
}
|
||||
for each(var k2:String in staticPara)
|
||||
{
|
||||
if(this[k2] is PointLocker)
|
||||
{
|
||||
this[k2].val = getTable()[k2];
|
||||
}
|
||||
else
|
||||
{
|
||||
this[k2] = getTable()[k2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getTable() : Object
|
||||
{
|
||||
return Table.item_info[type];
|
||||
}
|
||||
|
||||
public function get part() : int
|
||||
{
|
||||
return table().part;
|
||||
}
|
||||
|
||||
public function set part(val:int) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function get position() : Object
|
||||
{
|
||||
return table().position;
|
||||
}
|
||||
|
||||
public function set position(val:Object) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function getTip() : String
|
||||
{
|
||||
return name + "<br/>" + Paster.font(effectDes(true).join(","),"#be3cd5",18,true);
|
||||
}
|
||||
|
||||
public function effectDes(paraNameMode:Boolean = false) : Array
|
||||
{
|
||||
return getAbilityEffectDes(this,paraNameMode);
|
||||
}
|
||||
|
||||
public function getLimit() : EquipLimitVo
|
||||
{
|
||||
if(limit != null)
|
||||
{
|
||||
return limit;
|
||||
}
|
||||
if(table().limit == null)
|
||||
{
|
||||
limit = new EquipLimitVo();
|
||||
}
|
||||
else
|
||||
{
|
||||
limit = new EquipLimitVo();
|
||||
limit.onData(table().limit);
|
||||
}
|
||||
return limit;
|
||||
}
|
||||
|
||||
public function get spWord() : String
|
||||
{
|
||||
return table().spWord;
|
||||
}
|
||||
|
||||
public function get typeName() : String
|
||||
{
|
||||
return EquipType.partNameDic[part.toString()];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
package net.pixvi.myr.element.bag
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
|
||||
public class ItemType
|
||||
{
|
||||
|
||||
public static var TYPE_USEABLE:int = 1;
|
||||
|
||||
public static var TYPE_TOOL:int = 2;
|
||||
|
||||
public static var TYPE_MATERIAL:int = 3;
|
||||
|
||||
public static var TYPE_OTHER:int = 4;
|
||||
|
||||
public static var TYPE_EQUIP:int = 5;
|
||||
|
||||
public static var TYPE_EGG:int = 6;
|
||||
|
||||
public static var _equipDic:Object;
|
||||
|
||||
public static var _equipQuality:Object;
|
||||
|
||||
public static var typeDic:Array = [{
|
||||
"itemType":1,
|
||||
"name":"使用",
|
||||
"editname":"1.使用"
|
||||
},{
|
||||
"itemType":2,
|
||||
"name":"消耗",
|
||||
"editname":"2.消耗"
|
||||
},{
|
||||
"itemType":3,
|
||||
"name":"材料",
|
||||
"editname":"3.材料"
|
||||
},{
|
||||
"itemType":4,
|
||||
"name":"其他",
|
||||
"editname":"4.其他"
|
||||
},{
|
||||
"itemType":5,
|
||||
"name":"装备",
|
||||
"editname":"5.装备"
|
||||
},{
|
||||
"itemType":6,
|
||||
"name":"蛋",
|
||||
"editname":"6.装备"
|
||||
}];
|
||||
|
||||
public static var itemUseAction:Object = {
|
||||
"getTi":{
|
||||
"max":10,
|
||||
"min":1
|
||||
},
|
||||
"getKe":{
|
||||
"max":10,
|
||||
"min":2
|
||||
},
|
||||
"getMoney":{
|
||||
"max":100,
|
||||
"mon":3
|
||||
},
|
||||
"reward":{},
|
||||
"vipCard":{"day":30}
|
||||
};
|
||||
|
||||
public function ItemType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function get equipDic() : Object
|
||||
{
|
||||
if(_equipDic == null)
|
||||
{
|
||||
_equipDic = {
|
||||
"1":lang("武器"),
|
||||
"2":lang("防具"),
|
||||
"3":lang("饰品"),
|
||||
"4":lang("头部"),
|
||||
"5":lang("身体")
|
||||
};
|
||||
}
|
||||
return _equipDic;
|
||||
}
|
||||
|
||||
public static function get equipQuality() : Object
|
||||
{
|
||||
if(_equipQuality == null)
|
||||
{
|
||||
_equipQuality = {
|
||||
"1":{
|
||||
"name":lang("普通"),
|
||||
"color":"#ffffff"
|
||||
},
|
||||
"2":{
|
||||
"name":lang("精致"),
|
||||
"color":"#9cff00"
|
||||
},
|
||||
"3":{
|
||||
"name":lang("极品"),
|
||||
"color":"#66ffff"
|
||||
},
|
||||
"4":{
|
||||
"name":lang("史诗"),
|
||||
"color":"#ff66ff"
|
||||
},
|
||||
"5":{
|
||||
"name":lang("传说"),
|
||||
"color":"#ffff00"
|
||||
}
|
||||
};
|
||||
}
|
||||
return _equipQuality;
|
||||
}
|
||||
|
||||
public static function getName(itemType:int) : String
|
||||
{
|
||||
return typeDic[itemType - 1].name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,290 @@
|
||||
package net.pixvi.myr.element.bag
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.common.utils.PiObject;
|
||||
import net.pixvi.myr.CP;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.mon.EggVo;
|
||||
import net.pixvi.pfw.utils.PointLocker;
|
||||
import net.pixvi.pfw.utils.Saver;
|
||||
|
||||
public class ItemVo extends PiObject
|
||||
{
|
||||
|
||||
private static var _feedLock:Object = null;
|
||||
|
||||
public var id:Number;
|
||||
|
||||
public var type:int;
|
||||
|
||||
public var _num:PointLocker = new PointLocker();
|
||||
|
||||
public var itemdata:Object;
|
||||
|
||||
public var usingNum:int = 0;
|
||||
|
||||
public function ItemVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getImgSrc(type:int) : String
|
||||
{
|
||||
return "data/img/item/item_" + type + ".png";
|
||||
}
|
||||
|
||||
public static function getOrnamentImgSrc(type:int) : String
|
||||
{
|
||||
return "data/img/item/item_" + type + "_o.png";
|
||||
}
|
||||
|
||||
public static function getMaxNum(type:int) : int
|
||||
{
|
||||
return Table.item_info[type].maxNum;
|
||||
}
|
||||
|
||||
public static function getName(type:int) : String
|
||||
{
|
||||
return Table.item_info[type].name;
|
||||
}
|
||||
|
||||
public static function getQuality(type:int) : int
|
||||
{
|
||||
return Table.item_info[type].quality;
|
||||
}
|
||||
|
||||
public static function getItemType(type:int) : int
|
||||
{
|
||||
if(Table.monster_info[type] != null)
|
||||
{
|
||||
return ItemType.TYPE_EGG;
|
||||
}
|
||||
if(GameMath.ModeTrace && Table.item_info[type] == null)
|
||||
{
|
||||
Alert.yes("error","拥有不存在的道具[" + type + "]");
|
||||
}
|
||||
return Table.item_info[type].itemType;
|
||||
}
|
||||
|
||||
public static function getFrom(type:int) : String
|
||||
{
|
||||
return Table.item_info[type].from;
|
||||
}
|
||||
|
||||
public static function getTip(type:int, showName:Boolean = true) : String
|
||||
{
|
||||
if(Table.item_info[type].from != null && Table.item_info[type].from != "")
|
||||
{
|
||||
return "<b>" + Table.item_info[type].name + "</b><br/><center>" + Table.item_info[type].des + "<br/><center>" + CP.item(Table.item_info[type].from) + "</center>";
|
||||
}
|
||||
return "<b>" + Table.item_info[type].name + "</b><br/><center>" + Table.item_info[type].des;
|
||||
}
|
||||
|
||||
public function get num() : int
|
||||
{
|
||||
return _num.val;
|
||||
}
|
||||
|
||||
public function get showNum() : int
|
||||
{
|
||||
return _num.val - usingNum;
|
||||
}
|
||||
|
||||
public function get feedLock() : Boolean
|
||||
{
|
||||
if(_feedLock == null)
|
||||
{
|
||||
if(Saver.getAuto("feedLock" + Master.id) != null)
|
||||
{
|
||||
_feedLock = Saver.getAuto("feedLock" + Master.id);
|
||||
}
|
||||
else
|
||||
{
|
||||
_feedLock = {};
|
||||
}
|
||||
}
|
||||
if(_feedLock[id] == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return _feedLock[id];
|
||||
}
|
||||
|
||||
public function set feedLock(lock:Boolean) : void
|
||||
{
|
||||
if(_feedLock == null)
|
||||
{
|
||||
_feedLock = {};
|
||||
}
|
||||
_feedLock[id] = lock;
|
||||
Saver.saveAuto("feedLock" + Master.id,_feedLock);
|
||||
}
|
||||
|
||||
public function set num(value:int) : void
|
||||
{
|
||||
_num.val = value;
|
||||
}
|
||||
|
||||
public function get name() : String
|
||||
{
|
||||
return table().name;
|
||||
}
|
||||
|
||||
public function get para() : Object
|
||||
{
|
||||
if(table() == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return table().para;
|
||||
}
|
||||
|
||||
public function get itemType() : int
|
||||
{
|
||||
if(Table.monster_info[type] != null)
|
||||
{
|
||||
return ItemType.TYPE_EGG;
|
||||
}
|
||||
return table().itemType;
|
||||
}
|
||||
|
||||
public function get delayDay() : int
|
||||
{
|
||||
if(this is EggVo)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if(table().delayDay == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return table().delayDay;
|
||||
}
|
||||
|
||||
public function get des() : String
|
||||
{
|
||||
return table().des;
|
||||
}
|
||||
|
||||
public function get bz() : String
|
||||
{
|
||||
if(table().bz == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return table().bz;
|
||||
}
|
||||
|
||||
public function get desWithFrom() : String
|
||||
{
|
||||
if(table().from != null && table().from != "")
|
||||
{
|
||||
return des + "<br/><center>" + CP.item(from) + "</center>";
|
||||
}
|
||||
return des;
|
||||
}
|
||||
|
||||
public function get from() : String
|
||||
{
|
||||
if(table() == null)
|
||||
{
|
||||
return lang("获取:未知");
|
||||
}
|
||||
return lang("获取:{0}",table().from);
|
||||
}
|
||||
|
||||
public function get maxNum() : int
|
||||
{
|
||||
if(itemType == ItemType.TYPE_EQUIP)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return 2147483647;
|
||||
}
|
||||
|
||||
public function get imgsrc() : String
|
||||
{
|
||||
return getImgSrc(type);
|
||||
}
|
||||
|
||||
public function get quality() : int
|
||||
{
|
||||
return table().quality;
|
||||
}
|
||||
|
||||
public function get sellable() : Boolean
|
||||
{
|
||||
return table().sellable;
|
||||
}
|
||||
|
||||
public function get useable() : Boolean
|
||||
{
|
||||
return table().useable;
|
||||
}
|
||||
|
||||
public function get sellMoney() : int
|
||||
{
|
||||
return table().sellMoney;
|
||||
}
|
||||
|
||||
public function table() : Object
|
||||
{
|
||||
return Table.item_info[type];
|
||||
}
|
||||
|
||||
public function get popular() : int
|
||||
{
|
||||
return table().popular;
|
||||
}
|
||||
|
||||
public function get material() : Array
|
||||
{
|
||||
return table().material;
|
||||
}
|
||||
|
||||
public function loadItemData(itemData:Object) : void
|
||||
{
|
||||
this.id = itemData.id;
|
||||
this.type = itemData.typeId;
|
||||
this.num = itemData.num;
|
||||
}
|
||||
|
||||
public function getQ(q:int = 1) : int
|
||||
{
|
||||
if(quality == q)
|
||||
{
|
||||
return 9000000 + type;
|
||||
}
|
||||
return quality * 1000000 + type;
|
||||
}
|
||||
|
||||
public function get q1() : int
|
||||
{
|
||||
return getQ(1);
|
||||
}
|
||||
|
||||
public function get q2() : int
|
||||
{
|
||||
return getQ(2);
|
||||
}
|
||||
|
||||
public function get q3() : int
|
||||
{
|
||||
return getQ(3);
|
||||
}
|
||||
|
||||
public function get q4() : int
|
||||
{
|
||||
return getQ(4);
|
||||
}
|
||||
|
||||
public function get q5() : int
|
||||
{
|
||||
return getQ(5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package net.pixvi.myr.element.battle
|
||||
{
|
||||
import flash.geom.Rectangle;
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
|
||||
public class BaseBattleArea
|
||||
{
|
||||
|
||||
public var id:String;
|
||||
|
||||
public var type:String;
|
||||
|
||||
public var para:Object;
|
||||
|
||||
public var rec:Rectangle;
|
||||
|
||||
public var cooldown:Cooldowner;
|
||||
|
||||
public function BaseBattleArea()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function buildByObject(obj:Object) : void
|
||||
{
|
||||
this.id = obj.id;
|
||||
this.type = obj.type;
|
||||
this.para = obj.para;
|
||||
this.rec = new Rectangle(obj.x,obj.y,obj.w,obj.h);
|
||||
init();
|
||||
}
|
||||
|
||||
public function init() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function pause() : void
|
||||
{
|
||||
if(cooldown != null)
|
||||
{
|
||||
cooldown.pause();
|
||||
}
|
||||
}
|
||||
|
||||
public function resume() : void
|
||||
{
|
||||
if(cooldown != null)
|
||||
{
|
||||
cooldown.resume();
|
||||
}
|
||||
}
|
||||
|
||||
public function autoMon(mon:BattleMon) : void
|
||||
{
|
||||
if(rec.contains(mon.x,mon.y))
|
||||
{
|
||||
activity(mon);
|
||||
}
|
||||
}
|
||||
|
||||
public function activity(mon:BattleMon) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function cd() : Boolean
|
||||
{
|
||||
if(cooldown == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return cooldown.cooldown;
|
||||
}
|
||||
|
||||
public function activitycd() : void
|
||||
{
|
||||
if(cooldown == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
cooldown.activity();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package net.pixvi.myr.element.battle
|
||||
{
|
||||
import net.pixvi.pfw.utils.ObjectUtil;
|
||||
import net.pixvi.pfw.utils.json.Json;
|
||||
|
||||
public class BattleData
|
||||
{
|
||||
|
||||
public var battlePosition:BattlePosition;
|
||||
|
||||
public var win:Boolean;
|
||||
|
||||
private var _cheatNum:int = 0;
|
||||
|
||||
public var cheatRecords:CheatRecord;
|
||||
|
||||
public var killMonster:Object;
|
||||
|
||||
public var leftTime:int;
|
||||
|
||||
public var killNum:int;
|
||||
|
||||
public var totalDamage:int;
|
||||
|
||||
public var bossDamage:int;
|
||||
|
||||
public var deadNum:int;
|
||||
|
||||
public var aliveNum:int;
|
||||
|
||||
public var apLeft:int;
|
||||
|
||||
public var battleMonIds:Array;
|
||||
|
||||
public function BattleData()
|
||||
{
|
||||
super();
|
||||
cheatRecords = new CheatRecord();
|
||||
}
|
||||
|
||||
public function get cheatNum() : int
|
||||
{
|
||||
return _cheatNum;
|
||||
}
|
||||
|
||||
public function set cheatNum(value:int) : void
|
||||
{
|
||||
_cheatNum = value;
|
||||
}
|
||||
|
||||
public function getObj() : Object
|
||||
{
|
||||
var obj:Object = ObjectUtil.deepClone(this);
|
||||
if(cheatNum > 0)
|
||||
{
|
||||
obj.cheatRecords = Json.encode(obj.cheatRecords);
|
||||
}
|
||||
else
|
||||
{
|
||||
obj.cheatRecords = "";
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package net.pixvi.myr.element.battle
|
||||
{
|
||||
public class BattleFieldVo
|
||||
{
|
||||
|
||||
public var mapObjects:Array = [];
|
||||
|
||||
public var mapPoints:Array = [];
|
||||
|
||||
public var mapAreas:Array = [];
|
||||
|
||||
public var fieldName:String = "default";
|
||||
|
||||
public var fieldMode:Boolean = true;
|
||||
|
||||
public function BattleFieldVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,576 @@
|
||||
package net.pixvi.myr.element.battle
|
||||
{
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.battle.BattleModeType;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
import net.pixvi.myr.view.attack.BaseAttack;
|
||||
import net.pixvi.myr.view.attack.type.AttackType;
|
||||
import net.pixvi.pfw.utils.Mapper;
|
||||
import net.pixvi.pfw.utils.PointLocker;
|
||||
|
||||
public class BattleMonVo
|
||||
{
|
||||
|
||||
public var monsterVo:MonsterVo;
|
||||
|
||||
public var attack:BaseAttack;
|
||||
|
||||
public var ai:int = 0;
|
||||
|
||||
public var ai_search:int = 2;
|
||||
|
||||
public var from:String = "stage";
|
||||
|
||||
public var hpMax:int;
|
||||
|
||||
public var spd_mov:Number = -1;
|
||||
|
||||
public var spd_atk:Number = -1;
|
||||
|
||||
public var spd_atk_add:Number = 0;
|
||||
|
||||
public var atk_dis:Number = -1;
|
||||
|
||||
public var defDama:Number = 0;
|
||||
|
||||
private var _selfCure:PointLocker = new PointLocker();
|
||||
|
||||
private var _atkVim:PointLocker = new PointLocker();
|
||||
|
||||
private var _atkStun:PointLocker = new PointLocker();
|
||||
|
||||
public var atkStunTime:int = 0;
|
||||
|
||||
public var atkStunType:int = 1;
|
||||
|
||||
private var _defStun:PointLocker = new PointLocker();
|
||||
|
||||
public var defStunTime:int = 0;
|
||||
|
||||
public var defStunType:int = 1;
|
||||
|
||||
private var _atkPoi:PointLocker = new PointLocker();
|
||||
|
||||
private var _atkPoiDmg:PointLocker = new PointLocker();
|
||||
|
||||
public var atkPoiType:int = 1;
|
||||
|
||||
public var powDefPercent:Number = 0;
|
||||
|
||||
public var immuDebuff:Boolean = false;
|
||||
|
||||
public var skillCooldown:Number = 0;
|
||||
|
||||
private var _sunFire:PointLocker = new PointLocker();
|
||||
|
||||
private var _moonHeal:PointLocker = new PointLocker();
|
||||
|
||||
private var _deadBoom:PointLocker = new PointLocker();
|
||||
|
||||
private var _thorns:PointLocker = new PointLocker();
|
||||
|
||||
private var _apCostSave:PointLocker = new PointLocker();
|
||||
|
||||
public var pow:Number;
|
||||
|
||||
public var powdef:Number;
|
||||
|
||||
public var level:int;
|
||||
|
||||
public var type:int;
|
||||
|
||||
public var mode:int;
|
||||
|
||||
private var _atk:PointLocker = new PointLocker();
|
||||
|
||||
private var _def:PointLocker = new PointLocker();
|
||||
|
||||
private var _hp:PointLocker = new PointLocker();
|
||||
|
||||
private var _dex:PointLocker = new PointLocker();
|
||||
|
||||
public var crit:Number = 0;
|
||||
|
||||
public var dead:Boolean = false;
|
||||
|
||||
public var apCost:int = 0;
|
||||
|
||||
public var name:String;
|
||||
|
||||
public var element:int = 0;
|
||||
|
||||
private var dataobj:Object;
|
||||
|
||||
public var mid:Number;
|
||||
|
||||
public var buffImmune:Boolean = false;
|
||||
|
||||
public var moveImmune:Boolean = false;
|
||||
|
||||
public var controlImmune:Boolean = false;
|
||||
|
||||
public var countUnit:Boolean = true;
|
||||
|
||||
public var protectTarget:Boolean = false;
|
||||
|
||||
public var destroyTarget:Boolean = false;
|
||||
|
||||
public var summonUnit:Boolean = false;
|
||||
|
||||
public var skill_1:int = -1;
|
||||
|
||||
public var skill_1_lv:int = -1;
|
||||
|
||||
public var skill_1_chance:Number = -1;
|
||||
|
||||
public var skill_2:int = -1;
|
||||
|
||||
public var skill_2_lv:int = -1;
|
||||
|
||||
public var skill_2_chance:Number = -1;
|
||||
|
||||
public var joinPoint:String = "";
|
||||
|
||||
public var joinTime:int = -1;
|
||||
|
||||
public var controller:Array;
|
||||
|
||||
public var teamPos:int;
|
||||
|
||||
public var leader:Boolean;
|
||||
|
||||
public var team:int = 2;
|
||||
|
||||
public var isObject:Boolean = false;
|
||||
|
||||
public var zl:int = 0;
|
||||
|
||||
public var setOScale:Number;
|
||||
|
||||
public var wave:int = 1;
|
||||
|
||||
public var joinAction:String = "auto";
|
||||
|
||||
public var autoTarget:Boolean = true;
|
||||
|
||||
public var equips:Array = [];
|
||||
|
||||
public var attackArea:String = "";
|
||||
|
||||
public var apRecovery:Boolean = false;
|
||||
|
||||
public var bossPoint:int = 0;
|
||||
|
||||
public var abilityScaled:Boolean = false;
|
||||
|
||||
public function BattleMonVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function get selfCure() : Number
|
||||
{
|
||||
return _selfCure.val;
|
||||
}
|
||||
|
||||
public function set selfCure(value:Number) : void
|
||||
{
|
||||
_selfCure.val = value;
|
||||
}
|
||||
|
||||
public function get atkVim() : Number
|
||||
{
|
||||
return _atkVim.val;
|
||||
}
|
||||
|
||||
public function set atkVim(value:Number) : void
|
||||
{
|
||||
_atkVim.val = value;
|
||||
}
|
||||
|
||||
public function get atkStun() : Number
|
||||
{
|
||||
return _atkStun.val;
|
||||
}
|
||||
|
||||
public function set atkStun(value:Number) : void
|
||||
{
|
||||
_atkStun.val = value;
|
||||
}
|
||||
|
||||
public function get defStun() : Number
|
||||
{
|
||||
return _defStun.val;
|
||||
}
|
||||
|
||||
public function set defStun(value:Number) : void
|
||||
{
|
||||
_defStun.val = value;
|
||||
}
|
||||
|
||||
public function get atkPoi() : Number
|
||||
{
|
||||
return _atkPoi.val;
|
||||
}
|
||||
|
||||
public function set atkPoi(value:Number) : void
|
||||
{
|
||||
_atkPoi.val = value;
|
||||
}
|
||||
|
||||
public function get atkPoiDmg() : int
|
||||
{
|
||||
return _atkPoiDmg.val;
|
||||
}
|
||||
|
||||
public function set atkPoiDmg(value:int) : void
|
||||
{
|
||||
_atkPoiDmg.val = value;
|
||||
}
|
||||
|
||||
public function get sunFire() : int
|
||||
{
|
||||
return _sunFire.val;
|
||||
}
|
||||
|
||||
public function set sunFire(value:int) : void
|
||||
{
|
||||
_sunFire.val = value;
|
||||
}
|
||||
|
||||
public function get moonHeal() : int
|
||||
{
|
||||
return _moonHeal.val;
|
||||
}
|
||||
|
||||
public function set moonHeal(value:int) : void
|
||||
{
|
||||
_moonHeal.val = value;
|
||||
}
|
||||
|
||||
public function get deadBoom() : int
|
||||
{
|
||||
return _deadBoom.val;
|
||||
}
|
||||
|
||||
public function set deadBoom(value:int) : void
|
||||
{
|
||||
_deadBoom.val = value;
|
||||
}
|
||||
|
||||
public function get thorns() : int
|
||||
{
|
||||
return _thorns.val;
|
||||
}
|
||||
|
||||
public function set thorns(value:int) : void
|
||||
{
|
||||
_thorns.val = value;
|
||||
}
|
||||
|
||||
public function get dex() : int
|
||||
{
|
||||
return _dex.val;
|
||||
}
|
||||
|
||||
public function set dex(value:int) : void
|
||||
{
|
||||
_dex.val = value;
|
||||
}
|
||||
|
||||
public function get def() : int
|
||||
{
|
||||
return _def.val;
|
||||
}
|
||||
|
||||
public function set def(value:int) : void
|
||||
{
|
||||
_def.val = value;
|
||||
}
|
||||
|
||||
public function get atk() : int
|
||||
{
|
||||
return _atk.val;
|
||||
}
|
||||
|
||||
public function set atk(value:int) : void
|
||||
{
|
||||
_atk.val = value;
|
||||
}
|
||||
|
||||
public function buildByMonster(mon:MonsterVo) : void
|
||||
{
|
||||
monsterVo = mon;
|
||||
attack = AttackType.getAttack(monsterVo.atk_type.toString());
|
||||
if(atk_dis == -1)
|
||||
{
|
||||
atk_dis = monsterVo.atk_dis;
|
||||
}
|
||||
if(spd_mov == -1)
|
||||
{
|
||||
spd_mov = monsterVo.spd_move + GameMath.addMovSpdByDex(monsterVo.dex);
|
||||
}
|
||||
if(spd_atk == -1)
|
||||
{
|
||||
spd_atk = monsterVo.spd_atk + GameMath.addAtkSpdByDex(monsterVo.dex);
|
||||
}
|
||||
if(mon.upStar > 0)
|
||||
{
|
||||
skill_1 = mon.skill_1;
|
||||
skill_2 = mon.skill_2;
|
||||
}
|
||||
spd_atk -= 1600 * monsterVo.allAdd("atkSpd") / 100;
|
||||
this.apCost = monsterVo.ap_cost - monsterVo.allAdd("apCostSave");
|
||||
if(this.apCost < 0)
|
||||
{
|
||||
this.apCost = 0;
|
||||
}
|
||||
this.atk = monsterVo.atk;
|
||||
this.def = monsterVo.def;
|
||||
this.dex = monsterVo.dex;
|
||||
this.hpMax = this.hp = monsterVo.hp;
|
||||
this.deadBoom = monsterVo.allAdd("deadBoom");
|
||||
this.level = monsterVo.level;
|
||||
this.mode = monsterVo.mode;
|
||||
this.type = monsterVo.type;
|
||||
this.name = monsterVo.name;
|
||||
this.mid = monsterVo.id;
|
||||
pow = monsterVo.pow + GameMath.addPowByAtk(monsterVo.atk);
|
||||
powdef = monsterVo.powdef + GameMath.addPowDefByHp(monsterVo.hp);
|
||||
zl = GameMath.zl_battleMonVo(this);
|
||||
}
|
||||
|
||||
public function buildSpecialByMonster(monVo:MonsterVo) : void
|
||||
{
|
||||
crit = monsterVo.allAdd("crit");
|
||||
selfCure = monsterVo.allAdd("selfCure");
|
||||
atkVim = monsterVo.allAdd("atkVim");
|
||||
atkStun = monsterVo.allAdd("atkStun");
|
||||
atkStunTime = 2;
|
||||
atkStunType = monsterVo.equipType("atkStun","atkStunType");
|
||||
defStun = monsterVo.allAdd("defStun");
|
||||
defStunTime = 2;
|
||||
defStunType = monsterVo.equipType("defStun","defStunType");
|
||||
atkPoi = monsterVo.allAdd("atkPoi");
|
||||
atkPoiDmg = monsterVo.allAdd("atkPoiDmg");
|
||||
atkPoiType = monsterVo.equipType("atkPoi","atkPoiType");
|
||||
skillCooldown = monsterVo.allAdd("skillCooldown");
|
||||
sunFire = monsterVo.allAdd("sunFire");
|
||||
moonHeal = monsterVo.allAdd("moonHeal");
|
||||
thorns = monsterVo.allAdd("thorns");
|
||||
var spWords:Array = monsterVo.getAllSpWord();
|
||||
for each(var spWord:String in spWords)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public function clone(changeMode:int = -1, changeType:int = -1) : BattleMonVo
|
||||
{
|
||||
var vo:BattleMonVo = new BattleMonVo();
|
||||
var monvo:MonsterVo = this.monsterVo.clone();
|
||||
if(changeMode != -1)
|
||||
{
|
||||
monvo.mode = changeMode;
|
||||
}
|
||||
if(changeType != -1)
|
||||
{
|
||||
monvo.skin = 0;
|
||||
monvo.type = changeType;
|
||||
}
|
||||
vo.buildByMonster(monvo);
|
||||
vo.hp = this.hp;
|
||||
vo.hpMax = this.hpMax;
|
||||
vo.ai = this.ai;
|
||||
vo.ai_search = this.ai_search;
|
||||
if(this.apCost < vo.apCost)
|
||||
{
|
||||
vo.apCost = this.apCost;
|
||||
}
|
||||
vo.atk = this.atk;
|
||||
vo.atk_dis = this.atk_dis;
|
||||
vo.crit = this.crit;
|
||||
vo.def = this.def;
|
||||
vo.dex = this.dex;
|
||||
vo.level = this.level;
|
||||
vo.summonUnit = true;
|
||||
vo.setOScale = this.setOScale;
|
||||
return vo;
|
||||
}
|
||||
|
||||
public function buildByObject(o:Object, scaleAbility:Number = 1, scaleHp:Number = 1) : void
|
||||
{
|
||||
var mon:MonsterVo = null;
|
||||
dataobj = o;
|
||||
Mapper.fillVariables(this,o);
|
||||
if(o.powDefPercent != null && o.powDefPercent > 0)
|
||||
{
|
||||
powDefPercent = o.powDefPercent;
|
||||
}
|
||||
if(o.autoValue == true)
|
||||
{
|
||||
mon = new MonsterVo();
|
||||
monsterVo = mon;
|
||||
mon.init(o.type);
|
||||
mon.buildByArea();
|
||||
mon.level = o.level;
|
||||
mon.setLocalMode(o.mode);
|
||||
buildByMonster(mon);
|
||||
if(o.nicname == "" || o.nicname == null)
|
||||
{
|
||||
this.name = mon.name;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.name = o.nicname;
|
||||
}
|
||||
this.crit += o.crit;
|
||||
}
|
||||
else
|
||||
{
|
||||
monsterVo = new MonsterVo(type);
|
||||
monsterVo.setLocalMode(this.mode);
|
||||
attack = AttackType.getAttack(monsterVo.atk_type.toString());
|
||||
pow = monsterVo.pow;
|
||||
if(o.nicname == "" || o.nicname == null)
|
||||
{
|
||||
this.name = monsterVo.name;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.name = o.nicname;
|
||||
}
|
||||
powdef = monsterVo.powdef;
|
||||
crit = o.crit;
|
||||
zl = GameMath.zl_battleMonVo(this);
|
||||
}
|
||||
this.apCost = monsterVo.ap_cost - this.apCostSave;
|
||||
if(this.apCost < 0)
|
||||
{
|
||||
this.apCost = 0;
|
||||
}
|
||||
if(o.ornaments != null)
|
||||
{
|
||||
equips = o.ornaments;
|
||||
}
|
||||
if(o.apRecovery != null)
|
||||
{
|
||||
apRecovery = o.apRecovery;
|
||||
}
|
||||
if(o.bossPoint != null)
|
||||
{
|
||||
bossPoint = o.bossPoint;
|
||||
}
|
||||
if(!abilityScaled)
|
||||
{
|
||||
if(scaleAbility != 1 || scaleHp != 1)
|
||||
{
|
||||
this.atk *= scaleAbility;
|
||||
this.def *= scaleAbility;
|
||||
this.dex *= scaleAbility;
|
||||
this.deadBoom *= scaleAbility;
|
||||
this.sunFire *= scaleAbility;
|
||||
this.moonHeal *= scaleAbility;
|
||||
this.thorns *= scaleAbility;
|
||||
this.selfCure *= scaleAbility;
|
||||
this.level *= scaleAbility;
|
||||
for each(var c:Object in controller)
|
||||
{
|
||||
if(c.type == "hp")
|
||||
{
|
||||
c.para.hp *= scaleAbility;
|
||||
}
|
||||
else if(c.type == "deadBoom")
|
||||
{
|
||||
c.para.atk *= scaleAbility;
|
||||
}
|
||||
else if(c.type == "monMaker")
|
||||
{
|
||||
if(c.para.hp != null)
|
||||
{
|
||||
c.para.hp *= scaleHp;
|
||||
}
|
||||
if(c.para.hpMax != null)
|
||||
{
|
||||
c.para.hpMax *= scaleHp;
|
||||
}
|
||||
if(c.para.atk != null)
|
||||
{
|
||||
c.para.atk *= scaleAbility;
|
||||
}
|
||||
if(c.para.def != null)
|
||||
{
|
||||
c.para.def *= scaleAbility;
|
||||
}
|
||||
if(c.para.level != null)
|
||||
{
|
||||
c.para.level *= scaleAbility;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.hp *= scaleHp;
|
||||
}
|
||||
}
|
||||
monsterVo.id = o.mid;
|
||||
element = monsterVo.element;
|
||||
hpMax = hp;
|
||||
}
|
||||
|
||||
public function get hp() : int
|
||||
{
|
||||
return _hp.val;
|
||||
}
|
||||
|
||||
public function set hp(val:int) : void
|
||||
{
|
||||
_hp.val = val;
|
||||
}
|
||||
|
||||
public function get apCostSave() : int
|
||||
{
|
||||
return _apCostSave.val;
|
||||
}
|
||||
|
||||
public function set apCostSave(val:int) : void
|
||||
{
|
||||
_apCostSave.val = val;
|
||||
}
|
||||
|
||||
public function checkCheat(checkMon:BattleMonVo) : int
|
||||
{
|
||||
var cheat:int = 0;
|
||||
if(BattlePanel.getIns().battle.battleMode == BattleModeType.PVE)
|
||||
{
|
||||
if(atk * 1.5 < checkMon.atk || def * 1.5 < checkMon.def || hpMax * Table.game_setting.pveHpScale * 1.5 < checkMon.hpMax || dex * 1.5 < checkMon.dex || hpMax * Table.game_setting.pveHpScale * 1.5 < checkMon.hp)
|
||||
{
|
||||
cheat += 20;
|
||||
}
|
||||
}
|
||||
else if(atk * 1.5 < checkMon.atk || def * 1.5 < checkMon.def || hpMax * 1.5 < checkMon.hpMax || dex * 1.5 < checkMon.dex || hpMax * 1.5 < checkMon.hp)
|
||||
{
|
||||
cheat += 20;
|
||||
}
|
||||
if(crit * 1.5 < checkMon.crit || atkVim * 1.5 < checkMon.atkVim || sunFire * 1.5 < checkMon.sunFire || skillCooldown * 1.5 < checkMon.skillCooldown || atkPoi * 1.5 < checkMon.atkPoi || atkStun * 1.5 < checkMon.atkStun || atkPoiDmg * 1.5 < checkMon.atkPoiDmg)
|
||||
{
|
||||
cheat += 20;
|
||||
}
|
||||
return cheat;
|
||||
}
|
||||
|
||||
public function counter(target:BattleMonVo) : Boolean
|
||||
{
|
||||
if(Table.monster_setting.element[monsterVo.element].counter == target.monsterVo.element)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get hpPercent() : Number
|
||||
{
|
||||
return hp / hpMax;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
package net.pixvi.myr.element.battle
|
||||
{
|
||||
import net.pixvi.myr.center.StageCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.task.TaskStatusType;
|
||||
|
||||
public class BattlePosition
|
||||
{
|
||||
|
||||
public var battleType:String;
|
||||
|
||||
public var stageId:String;
|
||||
|
||||
public var stageLevel:String;
|
||||
|
||||
public var taskTypeId:String;
|
||||
|
||||
public var taskStep:int;
|
||||
|
||||
public function BattlePosition()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function getBattleData() : Object
|
||||
{
|
||||
switch(battleType)
|
||||
{
|
||||
case "stage":
|
||||
return StageCenter.getIns().getStageBattle(stageId,stageLevel);
|
||||
case BattleType.TASK_BATTLE:
|
||||
return Table.task_info[taskTypeId].steps[taskStep].battle;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getRewardData() : Object
|
||||
{
|
||||
switch(battleType)
|
||||
{
|
||||
case "stage":
|
||||
return StageCenter.getIns().getStageReward(stageId,stageLevel);
|
||||
case BattleType.TASK_BATTLE:
|
||||
return Table.task_info[taskTypeId].steps[taskStep].reward;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function isStageBattle() : Boolean
|
||||
{
|
||||
if(battleType == "stage")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if(battleType == BattleType.TASK_BATTLE && Table.task_info[taskTypeId].steps[taskStep].statusType == TaskStatusType.PASS_STAGE)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getStageId() : String
|
||||
{
|
||||
if(battleType == "stage")
|
||||
{
|
||||
return stageId;
|
||||
}
|
||||
if(battleType == BattleType.TASK_BATTLE && Table.task_info[taskTypeId].steps[taskStep].statusType == TaskStatusType.PASS_STAGE)
|
||||
{
|
||||
return Table.task_info[taskTypeId].steps[taskStep].statusValue.stage;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getStageLevel() : String
|
||||
{
|
||||
if(battleType == "stage")
|
||||
{
|
||||
return stageLevel;
|
||||
}
|
||||
if(battleType == BattleType.TASK_BATTLE && Table.task_info[taskTypeId].steps[taskStep].statusType == TaskStatusType.PASS_STAGE)
|
||||
{
|
||||
return Table.task_info[taskTypeId].steps[taskStep].statusValue.level;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,222 @@
|
||||
package net.pixvi.myr.element.battle
|
||||
{
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
import net.pixvi.pfw.utils.ArrayUtil;
|
||||
import net.pixvi.pfw.utils.Mapper;
|
||||
import net.pixvi.pfw.utils.PointLocker;
|
||||
|
||||
public class BattleTeamVo
|
||||
{
|
||||
|
||||
public static var enemyNormalPointByTeamPos:Object = {
|
||||
"0":"point_team{team}_fore1",
|
||||
"1":"point_team{team}_fore2",
|
||||
"2":"point_team{team}_fore3",
|
||||
"3":"point_team{team}_back1",
|
||||
"4":"point_team{team}_back2",
|
||||
"5":"point_team{team}_back3"
|
||||
};
|
||||
|
||||
public var mons:Array = [];
|
||||
|
||||
public var ai:int = 0;
|
||||
|
||||
public var ai_search:int = 2;
|
||||
|
||||
private var _ap:PointLocker;
|
||||
|
||||
public var apMax:int;
|
||||
|
||||
public var numMax:int;
|
||||
|
||||
public var name:String = "";
|
||||
|
||||
public var numOnStage:int = 0;
|
||||
|
||||
public var buildOver:Boolean = false;
|
||||
|
||||
public var team:int = 2;
|
||||
|
||||
public var wave:int = 1;
|
||||
|
||||
public var waveUnlock:Object = {
|
||||
"0":true,
|
||||
"1":true
|
||||
};
|
||||
|
||||
public var stageMons:Array = [];
|
||||
|
||||
public var deadMons:Array = [];
|
||||
|
||||
public var totalApCost:int = 0;
|
||||
|
||||
public var waitingWave:Boolean = false;
|
||||
|
||||
public function BattleTeamVo()
|
||||
{
|
||||
super();
|
||||
_ap = new PointLocker();
|
||||
}
|
||||
|
||||
public function buildMonster() : void
|
||||
{
|
||||
var k:int = 0;
|
||||
var mon:BattleMon = null;
|
||||
if(buildOver)
|
||||
{
|
||||
return;
|
||||
}
|
||||
k = 0;
|
||||
while(k < mons.length)
|
||||
{
|
||||
mon = new BattleMon();
|
||||
mon.teamVo = this;
|
||||
mon.init(mons[k]);
|
||||
mons[k] = mon;
|
||||
if(mon.team == 2)
|
||||
{
|
||||
if(mon.skill_1 != null)
|
||||
{
|
||||
mon.skill_1.cder.quickCountDown(2);
|
||||
}
|
||||
if(mon.skill_2 != null)
|
||||
{
|
||||
mon.skill_2.cder.quickCountDown(2);
|
||||
}
|
||||
}
|
||||
if(waveUnlock[mon.wave] == null)
|
||||
{
|
||||
waveUnlock[mon.wave] = false;
|
||||
}
|
||||
if(mon.monVo.joinPoint == "" && enemyNormalPointByTeamPos[mon.monVo.teamPos] != null)
|
||||
{
|
||||
mon.monVo.joinPoint = enemyNormalPointByTeamPos[mon.monVo.teamPos];
|
||||
mon.monVo.joinPoint = mon.monVo.joinPoint.replace("{team}",mon.team);
|
||||
}
|
||||
k++;
|
||||
}
|
||||
buildOver = true;
|
||||
}
|
||||
|
||||
public function buildByObject(o:Object, scaleAbility:Number = 1, scaleHp:Number = 1) : void
|
||||
{
|
||||
Mapper.fillVariables(this,o);
|
||||
apMax = ap * 2;
|
||||
buildMonsterArray(mons,scaleAbility,scaleHp);
|
||||
}
|
||||
|
||||
private function buildMonsterArray(arr:Array, scaleAbility:Number = 1, scaleHp:Number = 1) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var vo:BattleMonVo = null;
|
||||
for(i = 0; i < arr.length; )
|
||||
{
|
||||
if(arr[i] != null)
|
||||
{
|
||||
vo = new BattleMonVo();
|
||||
vo.buildByObject(arr[i],scaleAbility,scaleHp);
|
||||
if(arr[i].mid == "" || arr[i].mid == null)
|
||||
{
|
||||
vo.mid = BattlePanel.getTempMID();
|
||||
}
|
||||
else
|
||||
{
|
||||
vo.mid = arr[i].mid;
|
||||
}
|
||||
arr[i] = vo;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public function getAllMonster() : Array
|
||||
{
|
||||
var k:int = 0;
|
||||
if(!buildOver)
|
||||
{
|
||||
throw new Error("所有怪物在没有创建前调用!检查代码");
|
||||
}
|
||||
var arr:Array = [];
|
||||
for(k = 0; k < mons.length; )
|
||||
{
|
||||
if(mons[k] != null)
|
||||
{
|
||||
arr.push(mons[k]);
|
||||
}
|
||||
k++;
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
public function getWaitMonster() : Array
|
||||
{
|
||||
return mons;
|
||||
}
|
||||
|
||||
public function monDead(mon:BattleMon) : void
|
||||
{
|
||||
if(mon.monVo.countUnit)
|
||||
{
|
||||
numOnStage--;
|
||||
}
|
||||
ArrayUtil.remove(stageMons,mon);
|
||||
deadMons.push(mon);
|
||||
}
|
||||
|
||||
public function monJoin(mon:BattleMon) : void
|
||||
{
|
||||
ArrayUtil.remove(mons,mon);
|
||||
stageMons.push(mon);
|
||||
if(mon.monVo.countUnit)
|
||||
{
|
||||
numOnStage++;
|
||||
}
|
||||
}
|
||||
|
||||
public function cloneEmptyTeam() : BattleTeamVo
|
||||
{
|
||||
var team:BattleTeamVo = new BattleTeamVo();
|
||||
team.name = "???";
|
||||
team.ai = this.ai;
|
||||
team.ai_search = this.ai_search;
|
||||
team.ap = this.ap;
|
||||
team.apMax = this.apMax;
|
||||
team.buildOver = this.buildOver;
|
||||
team.numMax = this.numMax;
|
||||
team.team = this.team;
|
||||
return team;
|
||||
}
|
||||
|
||||
public function get ap() : int
|
||||
{
|
||||
return _ap.val;
|
||||
}
|
||||
|
||||
public function set ap(value:int) : void
|
||||
{
|
||||
_ap.val = value;
|
||||
}
|
||||
|
||||
public function getAliveNum() : int
|
||||
{
|
||||
var i:int = 0;
|
||||
for each(var mon:BattleMon in stageMons)
|
||||
{
|
||||
if(!mon.monVo.isObject)
|
||||
{
|
||||
i++;
|
||||
}
|
||||
}
|
||||
for each(var mon2:BattleMon in mons)
|
||||
{
|
||||
if(!mon2.monVo.isObject)
|
||||
{
|
||||
i++;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package net.pixvi.myr.element.battle
|
||||
{
|
||||
public class BattleType
|
||||
{
|
||||
|
||||
public static var TASK_BATTLE:String = "task";
|
||||
|
||||
public static const STAGE_BATTLE:String = "stage";
|
||||
|
||||
public static const PVE_BATTLE:String = "pve";
|
||||
|
||||
public static const BOSS_BATTLE:String = "boss";
|
||||
|
||||
public function BattleType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,259 @@
|
||||
package net.pixvi.myr.element.battle
|
||||
{
|
||||
import flash.geom.Point;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.reward.RewardVo;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.pfw.utils.ArrayUtil;
|
||||
import net.pixvi.pfw.utils.Mapper;
|
||||
import net.pixvi.pfw.utils.ObjectUtil;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class BattleVo
|
||||
{
|
||||
|
||||
public var reward:RewardVo;
|
||||
|
||||
public var builded:Boolean = false;
|
||||
|
||||
public var teams:Array = [];
|
||||
|
||||
public var teamDic:Object = {};
|
||||
|
||||
public var groundType:String = "1";
|
||||
|
||||
public var time:int = 300;
|
||||
|
||||
public var controller:Array = [];
|
||||
|
||||
public var triggers:Array = [];
|
||||
|
||||
public var winType:Array = [1];
|
||||
|
||||
public var loseType:Array = [1,2];
|
||||
|
||||
public var battleField:Object;
|
||||
|
||||
public var battleFieldVo:BattleFieldVo;
|
||||
|
||||
public var mapPoints:Object;
|
||||
|
||||
public var mapAreas:Object;
|
||||
|
||||
public var mapObjects:Object;
|
||||
|
||||
public var protectNum:int = 0;
|
||||
|
||||
public var protectMaxNum:int = 0;
|
||||
|
||||
public var destroyNum:int = 0;
|
||||
|
||||
public var destroyMaxNum:int = 0;
|
||||
|
||||
public var bgm:String = "1";
|
||||
|
||||
public var hideTeamMon:Boolean = false;
|
||||
|
||||
public var getBgm:String;
|
||||
|
||||
public var battleMode:int = 0;
|
||||
|
||||
public var scaleAbility:Number = 1;
|
||||
|
||||
public var scaleHp:Number = 1;
|
||||
|
||||
private var hasInitPve:Boolean = false;
|
||||
|
||||
public function BattleVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getBgm(bgm:String) : String
|
||||
{
|
||||
switch(bgm)
|
||||
{
|
||||
default:
|
||||
case "1":
|
||||
break;
|
||||
case "2":
|
||||
return GameSound.bgm_danger;
|
||||
case "3":
|
||||
return GameSound.bgm_battle2;
|
||||
}
|
||||
return GameSound.bgm_battle;
|
||||
}
|
||||
|
||||
public function battleBgm() : String
|
||||
{
|
||||
return BattleVo.getBgm(bgm);
|
||||
}
|
||||
|
||||
public function get rollmapMode() : Boolean
|
||||
{
|
||||
return Table.setting.groundType[groundType].rollMap;
|
||||
}
|
||||
|
||||
public function getTeam(team:int) : BattleTeamVo
|
||||
{
|
||||
return teamDic[team];
|
||||
}
|
||||
|
||||
public function getTeamWaitPointName(team:int) : String
|
||||
{
|
||||
var num:int = 0;
|
||||
while(mapPoints["point_team" + team + "_wait" + (num + 1)] != null)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
return "point_team" + team + "_wait" + Random.integer(1,num);
|
||||
}
|
||||
|
||||
public function buildByObject(o:Object) : void
|
||||
{
|
||||
var obj:Array = null;
|
||||
var area:Array = null;
|
||||
var i:int = 0;
|
||||
var vo:BattleTeamVo = null;
|
||||
o = ObjectUtil.deepClone(o);
|
||||
Mapper.fillVariables(this,o);
|
||||
battleFieldVo = new BattleFieldVo();
|
||||
if(o.scaleAbility != null || o.scaleHp != null)
|
||||
{
|
||||
this.scaleAbility = o.scaleAbility;
|
||||
this.scaleHp = o.scaleHp;
|
||||
for each(var cono:Object in controller)
|
||||
{
|
||||
if(cono.type == "monMaker")
|
||||
{
|
||||
if(cono.para.deadBoom != null)
|
||||
{
|
||||
cono.para.deadBoom *= scaleAbility;
|
||||
}
|
||||
if(cono.para.hp != null)
|
||||
{
|
||||
cono.para.hp *= scaleHp;
|
||||
}
|
||||
if(cono.para.hpMax != null)
|
||||
{
|
||||
cono.para.hpMax *= scaleHp;
|
||||
}
|
||||
if(cono.para.atk != null)
|
||||
{
|
||||
cono.para.atk *= scaleAbility;
|
||||
}
|
||||
if(cono.para.def != null)
|
||||
{
|
||||
cono.para.def *= scaleAbility;
|
||||
}
|
||||
if(cono.para.dex != null)
|
||||
{
|
||||
cono.para.dex *= scaleAbility;
|
||||
}
|
||||
if(cono.para.level != null)
|
||||
{
|
||||
cono.para.level *= scaleAbility;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(o.battleField.fieldMode)
|
||||
{
|
||||
obj = o.battleField.mapObjects;
|
||||
area = o.battleField.mapAreas;
|
||||
o.battleField = ObjectUtil.deepClone(Table.setting.defaultField[o.battleField.fieldName]);
|
||||
o.battleField.mapObjects = ObjectUtil.deepClone(obj);
|
||||
o.battleField.mapAreas = (o.battleField.mapAreas as Array).concat(ObjectUtil.deepClone(area));
|
||||
}
|
||||
Mapper.fillVariables(battleFieldVo,o.battleField);
|
||||
ArrayUtil.allToInt(o.winType);
|
||||
ArrayUtil.allToInt(o.loseType);
|
||||
for(i = 0; i < teams.length; )
|
||||
{
|
||||
vo = new BattleTeamVo();
|
||||
vo.buildByObject(teams[i],scaleAbility,scaleHp);
|
||||
teams[i] = vo;
|
||||
for each(var m:BattleMonVo in vo.mons)
|
||||
{
|
||||
if(m.protectTarget)
|
||||
{
|
||||
protectMaxNum++;
|
||||
}
|
||||
else if(m.destroyTarget)
|
||||
{
|
||||
destroyMaxNum++;
|
||||
}
|
||||
}
|
||||
teamDic[vo.team] = vo;
|
||||
i++;
|
||||
}
|
||||
protectNum = protectMaxNum;
|
||||
destroyNum = destroyMaxNum;
|
||||
if(o.time == -1)
|
||||
{
|
||||
o.time = GameMath.normalBattleTime;
|
||||
}
|
||||
time = o.time;
|
||||
mapPoints = ObjectUtil.tableToObject(battleFieldVo.mapPoints);
|
||||
mapObjects = ObjectUtil.tableToObject(battleFieldVo.mapObjects);
|
||||
mapAreas = ObjectUtil.tableToObject(battleFieldVo.mapAreas);
|
||||
}
|
||||
|
||||
public function fixMonTeamBeforeBuild() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var nt:BattleTeamVo = null;
|
||||
for each(var t:BattleTeamVo in teams)
|
||||
{
|
||||
for(i = 0; i < t.mons.length; )
|
||||
{
|
||||
if(t.mons[i].team != t.team)
|
||||
{
|
||||
if(teamDic[t.mons[i].team] == null)
|
||||
{
|
||||
nt = t.cloneEmptyTeam();
|
||||
nt.team = t.mons[i].team;
|
||||
teams.push(nt);
|
||||
teamDic[t.mons[i].team] = nt;
|
||||
}
|
||||
teamDic[t.mons[i].team].mons.push(t.mons.splice(i,1)[0]);
|
||||
i--;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getBattleArea() : Object
|
||||
{
|
||||
return mapAreas.area_battlefield;
|
||||
}
|
||||
|
||||
public function getBattleAreaRandomPoint() : Point
|
||||
{
|
||||
var p:Point = new Point();
|
||||
p.x = getBattleArea().x + getBattleArea().w * Math.random();
|
||||
p.y = getBattleArea().y + getBattleArea().h * Math.random();
|
||||
return p;
|
||||
}
|
||||
|
||||
public function initPve() : void
|
||||
{
|
||||
if(!hasInitPve)
|
||||
{
|
||||
for each(var team:BattleTeamVo in teams)
|
||||
{
|
||||
for each(var monvo:BattleMonVo in team.mons)
|
||||
{
|
||||
monvo.hp *= Table.game_setting.pveHpScale;
|
||||
monvo.hpMax = monvo.hp;
|
||||
}
|
||||
team.ap = team.apMax * Table.game_setting.pveApStartScale;
|
||||
}
|
||||
}
|
||||
trace("初始化pve魔物");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package net.pixvi.myr.element.battle
|
||||
{
|
||||
public class CheatRecord
|
||||
{
|
||||
|
||||
public var mons:Array = [];
|
||||
|
||||
public var damages:Array = [];
|
||||
|
||||
public var master:Object;
|
||||
|
||||
public var text:String = "";
|
||||
|
||||
public function CheatRecord()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function addRecord(str:String) : void
|
||||
{
|
||||
if(str.indexOf("skillTable_223") != -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(str.indexOf("skillTable_57") != -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
text += str + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package net.pixvi.myr.element.battle.battlearea
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.element.battle.BaseBattleArea;
|
||||
|
||||
public class BattleAreaHp extends BaseBattleArea
|
||||
{
|
||||
|
||||
public function BattleAreaHp()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cooldown = new Cooldowner(para.interval);
|
||||
}
|
||||
|
||||
override public function activity(mon:BattleMon) : void
|
||||
{
|
||||
if(para.team != null && para.team != mon.team)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(int(para.hp) > 0)
|
||||
{
|
||||
if(para.percentMode)
|
||||
{
|
||||
mon.beCure(4,mon.monVo.hpMax * para.hp,true);
|
||||
}
|
||||
else
|
||||
{
|
||||
mon.beCure(4,para.hp,true);
|
||||
}
|
||||
}
|
||||
else if(para.percentMode)
|
||||
{
|
||||
mon.beHurt(4,null,mon.monVo.hpMax * int(-para.hp),para.realAtk,false,0,0,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
mon.beHurt(4,null,int(-para.hp),para.realAtk,false,0,0,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package net.pixvi.myr.element.battle.battlearea
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.element.battle.BaseBattleArea;
|
||||
|
||||
public class BattleAreaMoveSpeed extends BaseBattleArea
|
||||
{
|
||||
|
||||
public function BattleAreaMoveSpeed()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cooldown = new Cooldowner(para.interval);
|
||||
}
|
||||
|
||||
override public function activity(mon:BattleMon) : void
|
||||
{
|
||||
if(para.team != null && para.team != mon.team)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(para.percentMode)
|
||||
{
|
||||
mon.buff.buff_movespd(para.speed * mon.all_movespd,para.time);
|
||||
}
|
||||
else
|
||||
{
|
||||
mon.buff.buff_movespd(para.speed,para.time);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package net.pixvi.myr.element.battle.battlearea
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.element.battle.BaseBattleArea;
|
||||
|
||||
public class BattleAreaPow extends BaseBattleArea
|
||||
{
|
||||
|
||||
public function BattleAreaPow()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cooldown = new Cooldowner(para.interval);
|
||||
}
|
||||
|
||||
override public function activity(mon:BattleMon) : void
|
||||
{
|
||||
var px:Number = NaN;
|
||||
var py:Number = NaN;
|
||||
if(para.fromX == null)
|
||||
{
|
||||
px = mon.x;
|
||||
}
|
||||
else
|
||||
{
|
||||
px = Number(para.fromX);
|
||||
}
|
||||
if(para.fromY == null)
|
||||
{
|
||||
py = mon.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
py = Number(para.fromY);
|
||||
}
|
||||
mon.givePow(para.pow,px,py,false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package net.pixvi.myr.element.battle.battlearea
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.element.battle.BaseBattleArea;
|
||||
|
||||
public class BattleAreaPowDef extends BaseBattleArea
|
||||
{
|
||||
|
||||
public function BattleAreaPowDef()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cooldown = new Cooldowner(para.interval);
|
||||
}
|
||||
|
||||
override public function activity(mon:BattleMon) : void
|
||||
{
|
||||
if(para.percentMode)
|
||||
{
|
||||
mon.buff.buff_powdef(mon.all_powdef * para.powdef,para.time);
|
||||
}
|
||||
else
|
||||
{
|
||||
mon.buff.buff_powdef(para.powdef,para.time);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package net.pixvi.myr.element.battle.battlearea
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.element.battle.BaseBattleArea;
|
||||
|
||||
public class BattleAreaSpeed extends BaseBattleArea
|
||||
{
|
||||
|
||||
public function BattleAreaSpeed()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cooldown = new Cooldowner(para.interval);
|
||||
}
|
||||
|
||||
override public function activity(mon:BattleMon) : void
|
||||
{
|
||||
mon.addSpd(para.speedX,para.speedY,para.maxX,para.maxY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
package net.pixvi.myr.element.battle.battlearea
|
||||
{
|
||||
import net.pixvi.myr.element.battle.BaseBattleArea;
|
||||
|
||||
public class BattleAreaType
|
||||
{
|
||||
|
||||
public static var dic:Object = {
|
||||
"none":{
|
||||
"type":"none",
|
||||
"des":"无类型",
|
||||
"para":{}
|
||||
},
|
||||
"hp":{
|
||||
"type":"hp",
|
||||
"des":"生命值",
|
||||
"para":{
|
||||
"interval":1000,
|
||||
"realAtk":true,
|
||||
"hp":-10,
|
||||
"percentMode":false
|
||||
}
|
||||
},
|
||||
"movespd":{
|
||||
"type":"movespd",
|
||||
"des":"移动速度",
|
||||
"para":{
|
||||
"interval":500,
|
||||
"time":500,
|
||||
"speed":0.5,
|
||||
"percentMode":true
|
||||
}
|
||||
},
|
||||
"pow":{
|
||||
"type":"pow",
|
||||
"des":"放射加速",
|
||||
"para":{
|
||||
"interval":250,
|
||||
"pow":2,
|
||||
"fromX":0,
|
||||
"fromY":0
|
||||
}
|
||||
},
|
||||
"speed":{
|
||||
"type":"speed",
|
||||
"des":"向量加速",
|
||||
"para":{
|
||||
"interval":250,
|
||||
"speedX":2,
|
||||
"speedY":2,
|
||||
"maxX":100,
|
||||
"maxY":100
|
||||
}
|
||||
},
|
||||
"powdef":{
|
||||
"type":"powdef",
|
||||
"des":"击退防御",
|
||||
"para":{
|
||||
"interval":500,
|
||||
"time":500,
|
||||
"powdef":-5,
|
||||
"percentMode":false
|
||||
}
|
||||
},
|
||||
"block":{
|
||||
"type":"block",
|
||||
"des":"障碍物",
|
||||
"para":{"interval":50}
|
||||
}
|
||||
};
|
||||
|
||||
public function BattleAreaType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getByType(type:String) : BaseBattleArea
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case "none":
|
||||
return new BaseBattleArea();
|
||||
case "hp":
|
||||
return new BattleAreaHp();
|
||||
case "movespd":
|
||||
return new BattleAreaMoveSpeed();
|
||||
case "pow":
|
||||
return new BattleAreaPow();
|
||||
case "speed":
|
||||
return new BattleAreaSpeed();
|
||||
case "powdef":
|
||||
return new BattleAreaPowDef();
|
||||
case "block":
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function getByVo(vo:Object) : BaseBattleArea
|
||||
{
|
||||
var base:BaseBattleArea = getByType(vo.type);
|
||||
base.buildByObject(vo);
|
||||
return base;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
package net.pixvi.myr.element.battle.battlecontroller
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
import net.pixvi.pfw.interfaces.IDispose;
|
||||
|
||||
public class BaseBattleController implements IDispose
|
||||
{
|
||||
|
||||
public var id:String;
|
||||
|
||||
public var type:String;
|
||||
|
||||
public var para:Object;
|
||||
|
||||
public var timer:Cooldowner;
|
||||
|
||||
public var afterWave:int = -1;
|
||||
|
||||
public var afterWaveTeam:int = 2;
|
||||
|
||||
public var afterTime:int = 0;
|
||||
|
||||
public var beforeTime:int = 0;
|
||||
|
||||
public var activited:Boolean = true;
|
||||
|
||||
public function BaseBattleController()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function buildByObject(obj:Object) : void
|
||||
{
|
||||
this.id = obj.id;
|
||||
this.type = obj.type;
|
||||
this.para = obj.para;
|
||||
timer = new Cooldowner(this.para.interval);
|
||||
if(this.para.beforeTime != null)
|
||||
{
|
||||
beforeTime = this.para.beforeTime;
|
||||
if(beforeTime < 1000)
|
||||
{
|
||||
beforeTime *= 1000;
|
||||
}
|
||||
}
|
||||
if(this.para.afterTime != null)
|
||||
{
|
||||
afterTime = this.para.afterTime;
|
||||
if(afterTime < 1000)
|
||||
{
|
||||
afterTime *= 1000;
|
||||
}
|
||||
}
|
||||
if(this.para.afterWave != null)
|
||||
{
|
||||
afterWave = this.para.afterWave;
|
||||
}
|
||||
if(this.para.afterWaveTeam != null)
|
||||
{
|
||||
afterWaveTeam = this.para.afterWaveTeam;
|
||||
}
|
||||
if(this.para.activited != null)
|
||||
{
|
||||
activited = this.para.activited;
|
||||
}
|
||||
init();
|
||||
}
|
||||
|
||||
public function start() : void
|
||||
{
|
||||
timer.resume();
|
||||
}
|
||||
|
||||
public function init() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function step() : void
|
||||
{
|
||||
if(!activited)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(afterTime > 0 && BattlePanel.getT().passTime < afterTime)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(beforeTime > 0 && BattlePanel.getT().passTime > beforeTime)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(afterWave >= 0 && BattlePanel.getIns().ground.vo.getTeam(afterWaveTeam).wave < afterWave)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(timer.cooldown)
|
||||
{
|
||||
timer.activity();
|
||||
activity();
|
||||
}
|
||||
}
|
||||
|
||||
public function activity() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function pause() : void
|
||||
{
|
||||
timer.pause();
|
||||
}
|
||||
|
||||
public function resume() : void
|
||||
{
|
||||
timer.resume();
|
||||
}
|
||||
|
||||
public function dispose() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
package net.pixvi.myr.element.battle.battlecontroller
|
||||
{
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class BattleControllerBuff extends BaseBattleController
|
||||
{
|
||||
|
||||
public function BattleControllerBuff()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function activity() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var mon:BattleMon = null;
|
||||
var num:int = 0;
|
||||
var j:int = 0;
|
||||
var targetMons:Array = [];
|
||||
for(i = 0; i < BattlePanel.getIns().ground.monsters.length; )
|
||||
{
|
||||
mon = BattlePanel.getIns().ground.monsters[i];
|
||||
if(!mon.monVo.dead)
|
||||
{
|
||||
if(para.targetMode == "all")
|
||||
{
|
||||
targetMons.push(mon);
|
||||
}
|
||||
else if(para.targetMode == "team" && mon.team.toString() == para.target)
|
||||
{
|
||||
targetMons.push(mon);
|
||||
}
|
||||
else if(para.targetMode == "mon")
|
||||
{
|
||||
if(para.target is Array && para.target.indexOf(mon.mid.toString()) != -1)
|
||||
{
|
||||
targetMons.push(mon);
|
||||
}
|
||||
else if(mon.mid.toString() == para.target)
|
||||
{
|
||||
targetMons.push(mon);
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(targetMons.length > 0)
|
||||
{
|
||||
num = int(targetMons.length);
|
||||
if(para.randomTarget > 0)
|
||||
{
|
||||
targetMons = Random.randomArr(targetMons);
|
||||
num = int(para.randomTarget);
|
||||
if(num > targetMons.length)
|
||||
{
|
||||
num = int(targetMons.length);
|
||||
}
|
||||
}
|
||||
for(j = 0; j < num; )
|
||||
{
|
||||
if(para.randomChance == 1 || para.randomChance < 1 && Math.random() < para.randomChance)
|
||||
{
|
||||
(targetMons[j] as BattleMon).buff.activityByObjectType2(para);
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
package net.pixvi.myr.element.battle.battlecontroller
|
||||
{
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class BattleControllerMonBuff extends BaseBattleController
|
||||
{
|
||||
|
||||
public function BattleControllerMonBuff()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function activity() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var mon:BattleMon = null;
|
||||
var num:int = 0;
|
||||
var j:int = 0;
|
||||
var targetMons:Array = [];
|
||||
for(i = 0; i < BattlePanel.getIns().ground.monsters.length; )
|
||||
{
|
||||
mon = BattlePanel.getIns().ground.monsters[i];
|
||||
if(!mon.monVo.dead)
|
||||
{
|
||||
if(para.targetMode == "all")
|
||||
{
|
||||
targetMons.push(mon);
|
||||
}
|
||||
else if(para.targetMode == "team" && mon.team.toString() == para.target)
|
||||
{
|
||||
targetMons.push(mon);
|
||||
}
|
||||
else if(para.targetMode == "mon")
|
||||
{
|
||||
if(para.target is Array && para.target.indexOf(mon.mid.toString()) != -1)
|
||||
{
|
||||
targetMons.push(mon);
|
||||
}
|
||||
else if(mon.mid.toString() == para.target)
|
||||
{
|
||||
targetMons.push(mon);
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(targetMons.length > 0)
|
||||
{
|
||||
num = int(targetMons.length);
|
||||
if(para.randomTarget > 0)
|
||||
{
|
||||
targetMons = Random.randomArr(targetMons);
|
||||
num = int(para.randomTarget);
|
||||
if(num > targetMons.length)
|
||||
{
|
||||
num = int(targetMons.length);
|
||||
}
|
||||
}
|
||||
for(j = 0; j < num; )
|
||||
{
|
||||
if(para.randomChance == 1 || para.randomChance < 1 && Math.random() < para.randomChance)
|
||||
{
|
||||
((targetMons[j] as BattleMon).buff[para.buffFunction] as Function).apply(mon,para.buffPara);
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
package net.pixvi.myr.element.battle.battlecontroller
|
||||
{
|
||||
import net.pixvi.common.effect.effects.FlashEffect;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.center.BattleCenter;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class BattleControllerMonMaker extends BaseBattleController
|
||||
{
|
||||
|
||||
public function BattleControllerMonMaker()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function activity() : void
|
||||
{
|
||||
var m:BattleMon = BattleCenter.getIns().makeBattleMon(para.monType,para.level,para.team,para.mode,para.oscale * BattleMon.OSCALE,para.name);
|
||||
m.monVo.ai = para.ai;
|
||||
m.monVo.ai_search = para.ai_search;
|
||||
if(para.bossPoint != null)
|
||||
{
|
||||
m.monVo.bossPoint = para.bossPoint;
|
||||
}
|
||||
if(para.deadBoom != null)
|
||||
{
|
||||
m.buff.deadboom_atk = para.deadBoom;
|
||||
m.buff.deadboom_length = 300;
|
||||
m.buff.deadboom_pow = 10;
|
||||
m.buff.open_deadboom = true;
|
||||
}
|
||||
if(para.hpBuff != null)
|
||||
{
|
||||
m.buff.buff_hps(para.hpBuff,60000,para.hpBuffInternal);
|
||||
}
|
||||
if(para.canMove != null)
|
||||
{
|
||||
m.moveable = para.canMove;
|
||||
}
|
||||
if(para.isObject != null)
|
||||
{
|
||||
m.monVo.isObject = para.isObject;
|
||||
}
|
||||
var pointname:String = "";
|
||||
if((para.point as String).indexOf(",") > 0)
|
||||
{
|
||||
pointname = Random.element((para.point as String).split(",")).toString();
|
||||
}
|
||||
else
|
||||
{
|
||||
pointname = para.point;
|
||||
}
|
||||
var point:Object = BattlePanel.getIns().battle.mapPoints[pointname];
|
||||
m.x = point.x + Math.random() * point.w;
|
||||
m.y = point.y + Math.random() * point.h;
|
||||
m.faceTo(point.face);
|
||||
m.addSpd(para.speedX,para.speedY);
|
||||
var color:uint = uint(Paster.parseColor(para.flashColor));
|
||||
if(color)
|
||||
{
|
||||
new FlashEffect(600,color,para.flashAmount);
|
||||
}
|
||||
if(para.joinAction != null)
|
||||
{
|
||||
m.monVo.joinAction = para.joinAction;
|
||||
}
|
||||
if(para.hp != null)
|
||||
{
|
||||
m.monVo.hp = m.monVo.hpMax = para.hp;
|
||||
}
|
||||
if(para.hpMax != null)
|
||||
{
|
||||
m.monVo.hpMax = para.hpMax;
|
||||
}
|
||||
if(para.atk != null)
|
||||
{
|
||||
m.monVo.atk = para.atk;
|
||||
}
|
||||
if(para.atk_dis != null)
|
||||
{
|
||||
m.monVo.atk_dis = para.atk_dis;
|
||||
}
|
||||
BattlePanel.getIns().ground.addMonster(m,true,false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
package net.pixvi.myr.element.battle.battlecontroller
|
||||
{
|
||||
public class BattleControllerType
|
||||
{
|
||||
|
||||
public static var dic:Object = {
|
||||
"base":{
|
||||
"type":"base",
|
||||
"des":"基础通用属性",
|
||||
"para":{
|
||||
"activited":true,
|
||||
"beforeTime":0,
|
||||
"afterTime":0,
|
||||
"afterWave":0,
|
||||
"afterWaveTeam":2
|
||||
}
|
||||
},
|
||||
"none":{
|
||||
"type":"none",
|
||||
"des":"无",
|
||||
"para":{}
|
||||
},
|
||||
"monMaker":{
|
||||
"type":"monMaker",
|
||||
"des":"魔物发生器",
|
||||
"para":{
|
||||
"deadBoom":null,
|
||||
"hpBuff":null,
|
||||
"hpBuffInternal":null,
|
||||
"isObject":null,
|
||||
"canMove":null,
|
||||
"hp":null,
|
||||
"hpMax":null,
|
||||
"atk":null,
|
||||
"point":"point_team2_wait1",
|
||||
"joinAction":"none",
|
||||
"interval":5000,
|
||||
"monType":1001010,
|
||||
"level":1,
|
||||
"mode":2,
|
||||
"name":"",
|
||||
"oscale":0,
|
||||
"team":2,
|
||||
"ai":0,
|
||||
"ai_search":2,
|
||||
"speedX":0,
|
||||
"speedY":2,
|
||||
"flashColor":"#ffffff",
|
||||
"flashAmount":0.7
|
||||
}
|
||||
},
|
||||
"monBuff":{
|
||||
"type":"monBuff",
|
||||
"des":"魔物buff发生器",
|
||||
"para":{
|
||||
"target":"10001",
|
||||
"targetMode":"mon/team/all",
|
||||
"randomTarget":0,
|
||||
"randomChance":1,
|
||||
"interval":5000,
|
||||
"buffFunction":"",
|
||||
"buffPara":[]
|
||||
}
|
||||
},
|
||||
"buff":{
|
||||
"type":"buff",
|
||||
"des":"施加魔物buff",
|
||||
"para":{
|
||||
"target":"10001",
|
||||
"targetMode":"monId/team/all",
|
||||
"interval":5000,
|
||||
"buff":"stun",
|
||||
"movType":1,
|
||||
"randomTarget":0,
|
||||
"randomChance":1
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public function BattleControllerType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getByType(type:String) : BaseBattleController
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case "base":
|
||||
case "none":
|
||||
break;
|
||||
case "monMaker":
|
||||
return new BattleControllerMonMaker();
|
||||
case "monBuff":
|
||||
return new BattleControllerMonBuff();
|
||||
case "buff":
|
||||
return new BattleControllerBuff();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
return new BaseBattleController();
|
||||
}
|
||||
|
||||
public static function buildByObject(o:Object) : BaseBattleController
|
||||
{
|
||||
var b:BaseBattleController = getByType(o.type);
|
||||
b.buildByObject(o);
|
||||
return b;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.pfw.interfaces.IDispose;
|
||||
|
||||
public class BaseMonController implements IDispose
|
||||
{
|
||||
|
||||
public var mon:BattleMon;
|
||||
|
||||
public var id:String;
|
||||
|
||||
public var type:String;
|
||||
|
||||
public var para:Object;
|
||||
|
||||
public var openHurt:Boolean = false;
|
||||
|
||||
public function BaseMonController()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function buildByObject(obj:Object, mon:BattleMon) : void
|
||||
{
|
||||
this.id = obj.id;
|
||||
this.type = obj.type;
|
||||
this.para = obj.para;
|
||||
this.mon = mon;
|
||||
init();
|
||||
}
|
||||
|
||||
public function start() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function init() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function step() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function pause() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function resume() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function deadHandler() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function onHurt(damage:int, enemy:BattleMon) : Object
|
||||
{
|
||||
return {"damage":0};
|
||||
}
|
||||
|
||||
public function dispose() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
|
||||
public class MonControllerAdd extends BaseMonController
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public function MonControllerAdd()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
mon.monVo.pow += para.pow;
|
||||
mon.monVo.atk_dis += para.atkDis;
|
||||
mon.monVo.atkStun += para.atkStun;
|
||||
mon.monVo.defStun += para.defStun;
|
||||
mon.monVo.atkVim += para.vampire;
|
||||
mon.monVo.thorns += para.thorn;
|
||||
mon.monVo.atkPoi += para.poi;
|
||||
mon.monVo.atkPoiDmg += para.poiDamage;
|
||||
if(para.defDama != null)
|
||||
{
|
||||
mon.monVo.defDama += Number(para.defDama);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
|
||||
public class MonControllerBosouBoom extends BaseMonController
|
||||
{
|
||||
|
||||
public function MonControllerBosouBoom()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function deadHandler() : void
|
||||
{
|
||||
var tmon:BattleMon = null;
|
||||
var mons:Array = BattlePanel.getIns().ground.findMonsByMonNear(mon,para.w,para.h,para.exceptTeam);
|
||||
var vis:DisplayObject = mon.addMovByClassInGround("mov.hit26",0,2.4,1.5,6);
|
||||
TweenMax.to(vis,2,{"scaleX":vis.scaleX + 1.5});
|
||||
if(para.atk == null)
|
||||
{
|
||||
para.atk = 5;
|
||||
}
|
||||
for each(var m:BattleMon in mons)
|
||||
{
|
||||
m.buff.buff_bosou(para.time);
|
||||
m.buff.buff_atk(-m.all_atk * 0.5,para.time);
|
||||
tmon = BattlePanel.getIns().ground.findNearestMon(m.x,m.y,2000,m.team,m.mid);
|
||||
if(tmon != null)
|
||||
{
|
||||
m.stopTargetMove();
|
||||
m.targetMon = tmon;
|
||||
m.buff.addBuffMov("mov.BuffInsane","bosou",para.time,1,24,0,0,-50);
|
||||
m.beHurt(5,mon,para.atk,false,false,para.pow);
|
||||
m.addMovByClass("mov.hit26",0,1.5,1.5,12);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
|
||||
public class MonControllerBuff extends BaseMonController
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public function MonControllerBuff()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cd = new Cooldowner(para.interval);
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
cd.activity();
|
||||
}
|
||||
|
||||
override public function step() : void
|
||||
{
|
||||
var targetMon:BattleMon = null;
|
||||
if(cd.cooldown)
|
||||
{
|
||||
cd.activity();
|
||||
if(para.mid != null && para.mid != -1)
|
||||
{
|
||||
targetMon = BattlePanel.getIns().ground.findMonByMid(para.mid);
|
||||
}
|
||||
else
|
||||
{
|
||||
targetMon = mon;
|
||||
}
|
||||
if(targetMon == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
targetMon.buff.activityByObjectType2(para);
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
cd.pause();
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
cd.resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
|
||||
public class MonControllerBuffMon extends BaseMonController
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public function MonControllerBuffMon()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cd = new Cooldowner(para.interval);
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
cd.activity();
|
||||
}
|
||||
|
||||
override public function step() : void
|
||||
{
|
||||
var targetMon:BattleMon = null;
|
||||
if(cd.cooldown)
|
||||
{
|
||||
cd.activity();
|
||||
if(para.mid != null && para.mid != -1)
|
||||
{
|
||||
targetMon = BattlePanel.getIns().ground.findMonByMid(para.mid);
|
||||
}
|
||||
else
|
||||
{
|
||||
targetMon = mon;
|
||||
}
|
||||
if(targetMon == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
(targetMon.buff[para.func] as Function).apply(targetMon.buff,para.para);
|
||||
if(para.mov != null && (para.mov as Array).length > 0)
|
||||
{
|
||||
targetMon.buff.addBuffMov.apply(targetMon.buff,para.mov);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
cd.pause();
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
cd.resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
|
||||
public class MonControllerBuffMovie extends BaseMonController
|
||||
{
|
||||
|
||||
public var bmc:BitMovieClip;
|
||||
|
||||
public var wait:Boolean = false;
|
||||
|
||||
public function MonControllerBuffMovie()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
var bmc:BitMovieClip = null;
|
||||
if(mon.leg.readyActioning || mon.cacheHeight == -1)
|
||||
{
|
||||
Caller.delayCall(start,100);
|
||||
wait = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(mon.monVo.dead)
|
||||
{
|
||||
return;
|
||||
}
|
||||
bmc = mon.buff.addBuffMov(para.mov,para.type,int(para.time),para.scale,para.fps,para.position,para.floatX,para.floatY,para.front,para.stopMove,para.preCheck);
|
||||
if(bmc != null && wait)
|
||||
{
|
||||
wait = false;
|
||||
bmc.alpha = 0;
|
||||
TweenMax.to(bmc,0.5,{"alpha":1});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
super.pause();
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
super.resume();
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
super.dispose();
|
||||
Caller.stopCall(start);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
|
||||
public class MonControllerDeadBoom extends BaseMonController
|
||||
{
|
||||
|
||||
public function MonControllerDeadBoom()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function deadHandler() : void
|
||||
{
|
||||
if(para.mov == null)
|
||||
{
|
||||
para.mov = "mov.skill2";
|
||||
}
|
||||
SoundCenter.getIns().play(GameSound.soundName("skill_boom"));
|
||||
var mons:Array = BattlePanel.getIns().ground.findMonsByMonNear(mon,para.w,para.h,para.exceptTeam);
|
||||
mon.addMovByClassInGround(para.mov,0,1.8,1.8,30);
|
||||
for each(var m:BattleMon in mons)
|
||||
{
|
||||
m.buff.buff_bosou(para.time);
|
||||
m.beHurt(5,mon,para.atk,false,false,para.pow);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
|
||||
public class MonControllerFixHurt extends BaseMonController
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public function MonControllerFixHurt()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
openHurt = true;
|
||||
}
|
||||
|
||||
override public function onHurt(damage:int, enemy:BattleMon) : Object
|
||||
{
|
||||
var rpara:Object = {"damage":damage};
|
||||
if(enemy != null)
|
||||
{
|
||||
if(para.type[enemy.vo.element.toString()] != null)
|
||||
{
|
||||
rpara.damage = damage * para.element[enemy.vo.element.toString()];
|
||||
rpara.iscount = true;
|
||||
}
|
||||
else if(para.type[enemy.vo.type.toString()] != null)
|
||||
{
|
||||
rpara.damage = damage * para.type[enemy.vo.type.toString()];
|
||||
rpara.iscount = true;
|
||||
}
|
||||
}
|
||||
return rpara;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.BattleGround;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
|
||||
public class MonControllerHp extends BaseMonController
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public function MonControllerHp()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cd = new Cooldowner(para.interval);
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
cd.activity();
|
||||
}
|
||||
|
||||
override public function step() : void
|
||||
{
|
||||
var targetmon:BattleMon = null;
|
||||
var realAtk:Boolean = false;
|
||||
if(cd.cooldown)
|
||||
{
|
||||
cd.activity();
|
||||
if(para.mid == null || para.mid == -1)
|
||||
{
|
||||
targetmon = mon;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetmon = BattleGround.getIns().findMonByMid(para.mid);
|
||||
if(targetmon == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
realAtk = true;
|
||||
if(para.realAtk != null)
|
||||
{
|
||||
realAtk = Boolean(para.realAtk);
|
||||
}
|
||||
if(para.hp < 0)
|
||||
{
|
||||
targetmon.beHurt(9,null,-para.hp,realAtk,false,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
targetmon.beCure(12,para.hp,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
cd.pause();
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
cd.resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.BattleGround;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
|
||||
public class MonControllerHpArea extends BaseMonController
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public function MonControllerHpArea()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cd = new Cooldowner(para.interval);
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
cd.activity();
|
||||
}
|
||||
|
||||
override public function step() : void
|
||||
{
|
||||
var mons:Array = null;
|
||||
if(cd.cooldown)
|
||||
{
|
||||
cd.activity();
|
||||
mons = [];
|
||||
if(para.hp < 0)
|
||||
{
|
||||
mon.addMovByClass("mov.BuffSunFire",3,1.5,1.5,30,0,0,0,null,null,false);
|
||||
mons = BattleGround.getIns().findMonsByMonNear(mon,para.area,para.area * 0.6,mon.team);
|
||||
for each(var m:BattleMon in mons)
|
||||
{
|
||||
m.beHurt(6,mon,-para.hp,true,false,0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mon.addMovByClass("mov.BuffMoonHeal",3,1.5,1.5,30,0,0,0,null,null,false);
|
||||
mons = BattleGround.getIns().findMonsByMonNear(mon,para.area,para.area,mon.team == 1 ? 2 : 1);
|
||||
for each(var m2:BattleMon in mons)
|
||||
{
|
||||
m2.beCure(13,para.hp,false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
cd.pause();
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
cd.resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
|
||||
public class MonControllerLockTarget extends BaseMonController
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public function MonControllerLockTarget()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
var time:int = 1000;
|
||||
if(para.interval != null)
|
||||
{
|
||||
time = int(para.interval);
|
||||
}
|
||||
cd = new Cooldowner(time);
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
cd.activity();
|
||||
}
|
||||
|
||||
override public function step() : void
|
||||
{
|
||||
var targetMon:BattleMon = null;
|
||||
if(cd.cooldown)
|
||||
{
|
||||
cd.activity();
|
||||
targetMon = BattlePanel.getIns().ground.findMonByMid(para.mid);
|
||||
if(targetMon == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
mon.targetMon = targetMon;
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
cd.pause();
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
cd.resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.common.effect.effects.FlashEffect;
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.center.BattleCenter;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
|
||||
public class MonControllerMonMaker extends BaseMonController
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public function MonControllerMonMaker()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cd = new Cooldowner(para.interval);
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
cd.activity();
|
||||
}
|
||||
|
||||
override public function step() : void
|
||||
{
|
||||
var m:BattleMon = null;
|
||||
var color:* = 0;
|
||||
if(cd.cooldown)
|
||||
{
|
||||
cd.activity();
|
||||
m = BattleCenter.getIns().makeBattleMon(para.monType,para.level,para.team,para.mode,para.oscale * BattleMon.OSCALE);
|
||||
m.monVo.ai = para.ai;
|
||||
m.monVo.ai_search = para.ai_search;
|
||||
m.x = mon.x + para.floatX;
|
||||
m.y = mon.y + para.floatY;
|
||||
if(para.bossPoint != null)
|
||||
{
|
||||
m.monVo.bossPoint = para.bossPoint;
|
||||
}
|
||||
m.addSpd(para.speedX,para.speedY);
|
||||
color = uint(Paster.parseColor(para.flashColor));
|
||||
if(color)
|
||||
{
|
||||
new FlashEffect(600,color,para.flashAmount);
|
||||
}
|
||||
if(para.joinAction != null)
|
||||
{
|
||||
m.monVo.joinAction = para.joinAction;
|
||||
}
|
||||
if(para.hp != null)
|
||||
{
|
||||
m.monVo.hp = m.monVo.hpMax = para.hp;
|
||||
}
|
||||
if(para.hpMax != null)
|
||||
{
|
||||
m.monVo.hpMax = para.hpMax;
|
||||
}
|
||||
if(para.atk != null)
|
||||
{
|
||||
m.monVo.atk = para.atk;
|
||||
}
|
||||
BattlePanel.getIns().ground.addMonster(m,true,false);
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
cd.pause();
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
cd.resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
|
||||
public class MonControllerMonSkill extends BaseMonController
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public var skills:Array = [];
|
||||
|
||||
public var times:Array = [];
|
||||
|
||||
public var flag:int = 0;
|
||||
|
||||
public function MonControllerMonSkill()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cd = new Cooldowner(para.startTime);
|
||||
skills = para.skill;
|
||||
times = para.times;
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
cd.activity();
|
||||
}
|
||||
|
||||
override public function step() : void
|
||||
{
|
||||
if(cd.cooldown)
|
||||
{
|
||||
cd.activity();
|
||||
if(times != null)
|
||||
{
|
||||
cd.otime = times[flag];
|
||||
}
|
||||
if(skills[flag] == 1)
|
||||
{
|
||||
if(mon.skill_1 != null)
|
||||
{
|
||||
mon.skill_1.activity();
|
||||
}
|
||||
}
|
||||
else if(mon.skill_2 != null)
|
||||
{
|
||||
mon.skill_2.activity();
|
||||
}
|
||||
flag++;
|
||||
if(flag >= skills.length)
|
||||
{
|
||||
flag = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
cd.pause();
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
cd.resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import flash.geom.Point;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
|
||||
public class MonControllerMonSteps extends BaseMonController
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public var points:Array = [];
|
||||
|
||||
public var times:Array = [];
|
||||
|
||||
public var flag:int = 0;
|
||||
|
||||
public function MonControllerMonSteps()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cd = new Cooldowner(para.startTime);
|
||||
points = para.points;
|
||||
times = para.times;
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
cd.activity();
|
||||
}
|
||||
|
||||
override public function step() : void
|
||||
{
|
||||
var pointobj:Object = null;
|
||||
var x:int = 0;
|
||||
var y:int = 0;
|
||||
if(cd.cooldown)
|
||||
{
|
||||
cd.activity();
|
||||
if(times != null)
|
||||
{
|
||||
cd.otime = times[flag];
|
||||
}
|
||||
if(para.addSpd > 0 && para.addSpdTime > 0)
|
||||
{
|
||||
mon.buff.buff_movespd(mon.all_movespd * para.addSpd,para.addSpdTime);
|
||||
}
|
||||
pointobj = BattlePanel.getIns().battle.mapPoints[points[flag]];
|
||||
if(pointobj == null && GameMath.ModeTrace)
|
||||
{
|
||||
Alert.showMsg("魔物路劲控制器找不到point[" + points[flag] + "]");
|
||||
return;
|
||||
}
|
||||
x = pointobj.x + Math.random() * pointobj.w;
|
||||
y = pointobj.y + Math.random() * pointobj.h;
|
||||
mon.stopTargetMove();
|
||||
mon.targetPoint = new Point(x,y);
|
||||
flag++;
|
||||
if(flag >= points.length)
|
||||
{
|
||||
flag = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
cd.pause();
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
cd.resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
|
||||
public class MonControllerShowFace extends BaseMonController
|
||||
{
|
||||
|
||||
public function MonControllerShowFace()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
if(para.when == "born")
|
||||
{
|
||||
Caller.delayCall(showFaceDelay,para.delay);
|
||||
}
|
||||
if(para.when == "hurt")
|
||||
{
|
||||
mon.addEventListener(BattleMon.BE_HURT,beHurt);
|
||||
}
|
||||
}
|
||||
|
||||
private function showFaceDelay() : void
|
||||
{
|
||||
mon.showFace(para.face);
|
||||
}
|
||||
|
||||
private function beHurt(e:Event = null) : void
|
||||
{
|
||||
if(Math.random() < para.chance)
|
||||
{
|
||||
mon.showFace(para.face);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
public class MonControllerStatusMov extends BaseMonController
|
||||
{
|
||||
|
||||
public function MonControllerStatusMov()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
if(para.mov == "walk")
|
||||
{
|
||||
mon.monMov.statusWalk(para.delay);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,293 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
|
||||
public class MonControllerType
|
||||
{
|
||||
|
||||
public static var dic:Object = {
|
||||
"none":{
|
||||
"type":"none",
|
||||
"sort":1,
|
||||
"des":"无",
|
||||
"para":{}
|
||||
},
|
||||
"add":{
|
||||
"type":"add",
|
||||
"sort":1,
|
||||
"des":"特殊属性add(双倍)",
|
||||
"para":{
|
||||
"defDama":0,
|
||||
"thorn":0,
|
||||
"atkStun":0,
|
||||
"defStun":0,
|
||||
"vampire":0,
|
||||
"pow":0,
|
||||
"poi":0,
|
||||
"poiDamage":0,
|
||||
"atkDis":0
|
||||
}
|
||||
},
|
||||
"monMaker":{
|
||||
"type":"monMaker",
|
||||
"sort":2,
|
||||
"des":"魔物发生器",
|
||||
"para":{
|
||||
"hp":null,
|
||||
"hpMax":null,
|
||||
"atk":null,
|
||||
"joinAction":null,
|
||||
"interval":5000,
|
||||
"monType":1001010,
|
||||
"level":1,
|
||||
"mode":2,
|
||||
"name":"",
|
||||
"oscale":0,
|
||||
"team":2,
|
||||
"ai":0,
|
||||
"ai_search":2,
|
||||
"floatX":0,
|
||||
"floatY":0,
|
||||
"speedX":0,
|
||||
"speedY":2,
|
||||
"flashColor":"#ffffff",
|
||||
"flashAmount":0.7
|
||||
}
|
||||
},
|
||||
"showFace":{
|
||||
"type":"showFace",
|
||||
"sort":3,
|
||||
"des":"表情触发",
|
||||
"para":{
|
||||
"delay":1000,
|
||||
"face":4,
|
||||
"when":"born/hurt",
|
||||
"chance":1
|
||||
}
|
||||
},
|
||||
"monSteps":{
|
||||
"type":"monSteps",
|
||||
"sort":10,
|
||||
"des":"魔物路径器",
|
||||
"para":{
|
||||
"startTime":5000,
|
||||
"points":["point_team1_fore1"],
|
||||
"times":[5000],
|
||||
"addSpd":0.5,
|
||||
"addSpdTime":2000
|
||||
}
|
||||
},
|
||||
"hp":{
|
||||
"type":"hp",
|
||||
"des":"血量效果",
|
||||
"sort":5,
|
||||
"para":{
|
||||
"interval":5000,
|
||||
"hp":100,
|
||||
"mid":-1
|
||||
}
|
||||
},
|
||||
"skill":{
|
||||
"type":"skill",
|
||||
"des":"轮流释放技能",
|
||||
"sort":9,
|
||||
"para":{
|
||||
"startTime":5000,
|
||||
"skill":[1,2,1,1],
|
||||
"times":[5000,5000,5000,5000]
|
||||
}
|
||||
},
|
||||
"hunluanBoom":{
|
||||
"type":"hunluanBoom",
|
||||
"sort":8,
|
||||
"des":"死亡混乱BUFF",
|
||||
"para":{
|
||||
"time":3000,
|
||||
"w":250,
|
||||
"h":140,
|
||||
"pow":5,
|
||||
"atk":5,
|
||||
"exceptTeam":-1
|
||||
}
|
||||
},
|
||||
"deadBoom":{
|
||||
"type":"deadBoom",
|
||||
"sort":7,
|
||||
"des":"自爆BUFF",
|
||||
"para":{
|
||||
"w":200,
|
||||
"h":100,
|
||||
"pow":10,
|
||||
"atk":30,
|
||||
"exceptTeam":-1
|
||||
}
|
||||
},
|
||||
"hpArea":{
|
||||
"type":"hpArea",
|
||||
"sort":6,
|
||||
"des":"范围生命光环",
|
||||
"para":{
|
||||
"area":120,
|
||||
"hp":20,
|
||||
"interval":5000
|
||||
}
|
||||
},
|
||||
"buffMovie":{
|
||||
"type":"buffMovie",
|
||||
"sort":4.5,
|
||||
"des":"添加光环动画",
|
||||
"para":{
|
||||
"mov":"",
|
||||
"type":"none",
|
||||
"time":300000,
|
||||
"scale":1.2,
|
||||
"fps":30,
|
||||
"position":0,
|
||||
"floatX":0,
|
||||
"floatY":0,
|
||||
"front":false,
|
||||
"preCheck":false
|
||||
}
|
||||
},
|
||||
"buffMon":{
|
||||
"type":"buffMon",
|
||||
"sort":4,
|
||||
"des":"旧版buff",
|
||||
"para":{
|
||||
"interval":5000,
|
||||
"func":"buff_stun",
|
||||
"para":[1000],
|
||||
"mid":-1,
|
||||
"mov":["mov.BuffStun","stun",1000]
|
||||
}
|
||||
},
|
||||
"statusMov":{
|
||||
"type":"statusMov",
|
||||
"sort":13,
|
||||
"des":"改变状态动画",
|
||||
"para":{
|
||||
"mov":"walk",
|
||||
"delay":125
|
||||
}
|
||||
},
|
||||
"buff":{
|
||||
"type":"buff",
|
||||
"sort":0.5,
|
||||
"des":"添加buff",
|
||||
"para":{
|
||||
"interval":5000,
|
||||
"buff":"",
|
||||
"movType":1,
|
||||
"mid":-1
|
||||
}
|
||||
},
|
||||
"lockTarget":{
|
||||
"type":"lockTarget",
|
||||
"sort":14,
|
||||
"des":"锁定目标",
|
||||
"para":{"mid":"目标mid"}
|
||||
},
|
||||
"fixHurt":{
|
||||
"type":"fixHurt",
|
||||
"sort":15,
|
||||
"des":"伤害修改",
|
||||
"para":{
|
||||
"type":{"1001010":1.1},
|
||||
"element":{}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public function MonControllerType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getByType(type:String) : BaseMonController
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case "none":
|
||||
return new BaseMonController();
|
||||
case "add":
|
||||
return new MonControllerAdd();
|
||||
case "monMaker":
|
||||
return new MonControllerMonMaker();
|
||||
case "showFace":
|
||||
return new MonControllerShowFace();
|
||||
case "monSteps":
|
||||
return new MonControllerMonSteps();
|
||||
case "hp":
|
||||
return new MonControllerHp();
|
||||
case "skill":
|
||||
return new MonControllerMonSkill();
|
||||
case "hunluanBoom":
|
||||
return new MonControllerBosouBoom();
|
||||
case "deadBoom":
|
||||
return new MonControllerDeadBoom();
|
||||
case "hpArea":
|
||||
return new MonControllerHpArea();
|
||||
case "buffMovie":
|
||||
return new MonControllerBuffMovie();
|
||||
case "buffMon":
|
||||
return new MonControllerBuffMon();
|
||||
case "buff":
|
||||
return new MonControllerBuff();
|
||||
case "statusMov":
|
||||
return new MonControllerStatusMov();
|
||||
case "fixHurt":
|
||||
return new MonControllerFixHurt();
|
||||
case "lockTarget":
|
||||
return new MonControllerLockTarget();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static function buildByObject(o:Object, mon:BattleMon) : BaseMonController
|
||||
{
|
||||
var b:BaseMonController = getByType(o.type);
|
||||
b.buildByObject(o,mon);
|
||||
return b;
|
||||
}
|
||||
|
||||
public static function buildSunFire(mon:BattleMon, sunFire:int) : Object
|
||||
{
|
||||
var o:Object = {
|
||||
"type":"hpArea",
|
||||
"para":{
|
||||
"area":160,
|
||||
"hp":-sunFire,
|
||||
"interval":5000
|
||||
}
|
||||
};
|
||||
return buildByObject(o,mon);
|
||||
}
|
||||
|
||||
public static function buildMoonHeal(mon:BattleMon, moonHeal:int) : Object
|
||||
{
|
||||
var o:Object = {
|
||||
"type":"hpArea",
|
||||
"para":{
|
||||
"area":160,
|
||||
"hp":moonHeal,
|
||||
"interval":5000
|
||||
}
|
||||
};
|
||||
return buildByObject(o,mon);
|
||||
}
|
||||
|
||||
public static function buildSelfCure(mon:BattleMon, selfCure:Number) : Object
|
||||
{
|
||||
var o:Object = {
|
||||
"type":"hp",
|
||||
"para":{
|
||||
"interval":5000,
|
||||
"hp":selfCure
|
||||
}
|
||||
};
|
||||
return buildByObject(o,mon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,377 @@
|
||||
package net.pixvi.myr.element.battle.trigger
|
||||
{
|
||||
import net.pixvi.common.effect.effects.ShakeEffect;
|
||||
import net.pixvi.myr.battle.BattleGround;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.element.battle.BattleTeamVo;
|
||||
import net.pixvi.myr.element.battle.trigger.triggereffect.BaseTriggerEffect;
|
||||
import net.pixvi.myr.element.battle.trigger.triggereffect.DelayTriggerEffect;
|
||||
import net.pixvi.myr.view.skill.BaseSkill;
|
||||
import net.pixvi.pfw.utils.ArrayUtil;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
|
||||
public class BattleTrigger
|
||||
{
|
||||
|
||||
public var paraPool:Object;
|
||||
|
||||
public var ground:BattleGround;
|
||||
|
||||
public var effects:Array;
|
||||
|
||||
public var skillCount:Object = {};
|
||||
|
||||
public function BattleTrigger(ground:BattleGround)
|
||||
{
|
||||
super();
|
||||
this.ground = ground;
|
||||
effects = [];
|
||||
paraPool = {};
|
||||
}
|
||||
|
||||
public function checkEventTrigger(event:String, data:Object) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var trigger:Object = null;
|
||||
for(i = 0; i < ground.vo.triggers.length; )
|
||||
{
|
||||
trigger = ground.vo.triggers[i];
|
||||
if(trigger.type == "event" && trigger.para.event == event)
|
||||
{
|
||||
activity(trigger);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public function checkSkillTrigger(team:int) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var trigger:Object = null;
|
||||
if(skillCount[team.toString()] == null)
|
||||
{
|
||||
skillCount[team.toString()] = 0;
|
||||
}
|
||||
skillCount[team.toString()]++;
|
||||
for(i = 0; i < ground.vo.triggers.length; )
|
||||
{
|
||||
trigger = ground.vo.triggers[i];
|
||||
if(trigger.type == "useSkill" && int(trigger.para.team) == team)
|
||||
{
|
||||
if(skillCount[team.toString()] % trigger.para.num == 0)
|
||||
{
|
||||
activity(trigger);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public function checkTimeTrigger() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var trigger:Object = null;
|
||||
for(i = 0; i < ground.vo.triggers.length; )
|
||||
{
|
||||
trigger = ground.vo.triggers[i];
|
||||
if(trigger.type == "time" && trigger.para.time * 1000 <= ground.battleTime.passTime)
|
||||
{
|
||||
activity(trigger);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public function checkMonDeadTrigger(mon:BattleMon) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var trigger:Object = null;
|
||||
for(i = 0; i < ground.vo.triggers.length; )
|
||||
{
|
||||
trigger = ground.vo.triggers[i];
|
||||
if(trigger.type == "monDead" && trigger.para.mid == mon.mid)
|
||||
{
|
||||
activity(trigger);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public function checkTeamWaveStart(team:int = 2, wave:int = 2) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var trigger:Object = null;
|
||||
for(i = 0; i < ground.vo.triggers.length; )
|
||||
{
|
||||
trigger = ground.vo.triggers[i];
|
||||
if(trigger.type == "waveStart" && trigger.para.team == team && trigger.para.wave == wave)
|
||||
{
|
||||
activity(trigger);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public function activity(vo:Object) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
for(i = 0; i < vo.effects.length; )
|
||||
{
|
||||
effect(vo.effects[i]);
|
||||
i++;
|
||||
}
|
||||
var trigger:Object = ArrayUtil.getElementByValue(ground.vo.triggers,"id",vo.id);
|
||||
if(trigger != null && trigger.para.loop != null && trigger.para.loop == true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
ArrayUtil.removeByValue(ground.vo.triggers,"id",vo.id);
|
||||
}
|
||||
|
||||
public function pause() : void
|
||||
{
|
||||
for each(var e:BaseTriggerEffect in effects)
|
||||
{
|
||||
e.pause();
|
||||
}
|
||||
}
|
||||
|
||||
public function resume() : void
|
||||
{
|
||||
for each(var e:BaseTriggerEffect in effects)
|
||||
{
|
||||
e.resume();
|
||||
}
|
||||
}
|
||||
|
||||
public function stop() : void
|
||||
{
|
||||
for each(var e:BaseTriggerEffect in effects)
|
||||
{
|
||||
e.stop();
|
||||
}
|
||||
}
|
||||
|
||||
public function step() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var effect:BaseTriggerEffect = null;
|
||||
for(i = 0; i < effects.length; )
|
||||
{
|
||||
effect = effects[i];
|
||||
if(effect.completed)
|
||||
{
|
||||
effects.splice(i,1);
|
||||
i--;
|
||||
}
|
||||
else
|
||||
{
|
||||
effect.step();
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public function effect(vo:Object) : void
|
||||
{
|
||||
var mon:BattleMon = null;
|
||||
var o:Boolean = false;
|
||||
var eff:DelayTriggerEffect = null;
|
||||
var findMons:Array = null;
|
||||
var findmon:BattleMon = null;
|
||||
findMons = null;
|
||||
findmon = null;
|
||||
mon = null;
|
||||
var m:BattleMon = null;
|
||||
var shake:ShakeEffect = null;
|
||||
m = null;
|
||||
m = null;
|
||||
var con:Object = null;
|
||||
switch(vo.type)
|
||||
{
|
||||
case "none":
|
||||
return;
|
||||
case "monSkill":
|
||||
mon = ground.findMonByMid(vo.para.mid);
|
||||
if(mon != null && mon["skill_" + vo.para.skill] != null)
|
||||
{
|
||||
o = Boolean(mon["skill_" + vo.para.skill].startShow);
|
||||
if(vo.para.startShow != null && vo.para.startShow != -1)
|
||||
{
|
||||
if(vo.para.startShow == 0)
|
||||
{
|
||||
mon["skill_" + vo.para.skill].startShow = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
mon["skill_" + vo.para.skill].startShow = true;
|
||||
}
|
||||
}
|
||||
if(vo.para.delay > 0)
|
||||
{
|
||||
mon.buff.buff_stun(vo.para.delay);
|
||||
if(vo.para.mov != "")
|
||||
{
|
||||
mon.buff.addBuffMov(vo.para.mov,vo.para.type,vo.para.delay);
|
||||
}
|
||||
eff = new DelayTriggerEffect(vo);
|
||||
eff.init(vo.para.delay,delayChangeSkillShow,[mon["skill_" + vo.para.skill],o],mon);
|
||||
effects.push(eff);
|
||||
}
|
||||
else
|
||||
{
|
||||
mon["skill_" + vo.para.skill].activity();
|
||||
mon["skill_" + vo.para.skill].startShow = o;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "story":
|
||||
ground.storyStart(vo.para.script);
|
||||
break;
|
||||
case "buff":
|
||||
findMons = [];
|
||||
if(vo.para.mid is Array)
|
||||
{
|
||||
for each(var mids:int in vo.para.mid)
|
||||
{
|
||||
if(ground.findMonByMid(mids) != null)
|
||||
{
|
||||
findMons.push(ground.findMonByMid(mids));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
findmon = ground.findMonByMid(vo.para.mid);
|
||||
if(findmon != null)
|
||||
{
|
||||
findMons.push(findmon);
|
||||
}
|
||||
}
|
||||
for each(var resMon:BattleMon in findMons)
|
||||
{
|
||||
resMon.buff.activityByObjectType2(vo.para);
|
||||
}
|
||||
break;
|
||||
case "monBuff":
|
||||
findMons = [];
|
||||
if(vo.para.mid is Array)
|
||||
{
|
||||
for each(mids in vo.para.mid)
|
||||
{
|
||||
if(ground.findMonByMid(mids) != null)
|
||||
{
|
||||
findMons.push(ground.findMonByMid(mids));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
findmon = ground.findMonByMid(vo.para.mid);
|
||||
if(findmon != null)
|
||||
{
|
||||
findMons.push(findmon);
|
||||
}
|
||||
}
|
||||
for each(resMon in findMons)
|
||||
{
|
||||
resMon.buff.activityByObject(vo.para);
|
||||
}
|
||||
break;
|
||||
case "buffMov":
|
||||
mon = ground.findMonByMid(vo.para.mid);
|
||||
if(mon != null)
|
||||
{
|
||||
mon.buff.addBuffMov(vo.para.mov,vo.para.type,vo.para.time,vo.para.scale,vo.para.fps,vo.para.position,vo.para.floatX,vo.para.floatY,vo.para.front,vo.para.stopMovie);
|
||||
}
|
||||
break;
|
||||
case "event":
|
||||
checkEventTrigger(vo.para.event,vo.para.data);
|
||||
break;
|
||||
case "monJoin":
|
||||
m = ground.findMonByMid(vo.para.mid);
|
||||
if(m != null)
|
||||
{
|
||||
m.forceToStage = true;
|
||||
}
|
||||
break;
|
||||
case "unlockWave":
|
||||
(ground.vo.teamDic[vo.para.team] as BattleTeamVo).waveUnlock[vo.para.wave] = true;
|
||||
break;
|
||||
case "shake":
|
||||
if(vo.para.target == "all")
|
||||
{
|
||||
shake = new ShakeEffect(vo.para.xd,vo.para.yd,vo.para.damping);
|
||||
if(vo.para.delay != null)
|
||||
{
|
||||
shake.startEffect(ground);
|
||||
}
|
||||
else
|
||||
{
|
||||
Caller.delayCall(shake.startEffect,vo.para.delay,1,[ground]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m = ground.findMonByMid(vo.para.target);
|
||||
if(m != null)
|
||||
{
|
||||
shake = new ShakeEffect(vo.para.xd,vo.para.yd,vo.para.damping);
|
||||
if(vo.para.delay != null)
|
||||
{
|
||||
Caller.delayCall(shake.startEffect,vo.para.delay,1,[ground]);
|
||||
}
|
||||
else
|
||||
{
|
||||
shake.startEffect(ground);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "showFace":
|
||||
if(vo.para.target == "team")
|
||||
{
|
||||
for each(m in ground.monsters)
|
||||
{
|
||||
if(m.team == vo.para.id)
|
||||
{
|
||||
m.showFace(vo.para.face,vo.para.time);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(vo.para.target == "mon")
|
||||
{
|
||||
m = ground.findMonByMid(vo.para.id);
|
||||
if(m != null)
|
||||
{
|
||||
m.showFace(vo.para.face,vo.para.time);
|
||||
}
|
||||
}
|
||||
else if(vo.para.target == "all")
|
||||
{
|
||||
for each(m in ground.monsters)
|
||||
{
|
||||
m.showFace(vo.para.face,vo.para.time);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "startController":
|
||||
ArrayUtil.getElementByValue(ground.controllers,"id",vo.para.id).activited = true;
|
||||
break;
|
||||
case "stopController":
|
||||
con = ArrayUtil.getElementByValue(ground.controllers,"id",vo.para.id);
|
||||
if(con != null)
|
||||
{
|
||||
con.activited = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function delayChangeSkillShow(sk:BaseSkill, show:Boolean) : void
|
||||
{
|
||||
sk.activity();
|
||||
sk.startShow = show;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
package net.pixvi.myr.element.battle.trigger
|
||||
{
|
||||
public class BattleTriggerType
|
||||
{
|
||||
|
||||
public static const NONE:String = "none";
|
||||
|
||||
public static const TIME:String = "time";
|
||||
|
||||
public static const EVENT:String = "event";
|
||||
|
||||
public static const MON_DEAD:String = "monDead";
|
||||
|
||||
public static const WAVE_START:String = "waveStart";
|
||||
|
||||
public static const USE_SKILL:String = "useSkill";
|
||||
|
||||
public static var dic:Object = {
|
||||
"none":{
|
||||
"type":"none",
|
||||
"des":"无",
|
||||
"para":{}
|
||||
},
|
||||
"time":{
|
||||
"type":"time",
|
||||
"des":"时间触发",
|
||||
"para":{"time":5}
|
||||
},
|
||||
"event":{
|
||||
"type":"event",
|
||||
"des":"事件触发",
|
||||
"para":{"event":"触发事件"}
|
||||
},
|
||||
"monDead":{
|
||||
"type":"monDead",
|
||||
"des":"死亡触发",
|
||||
"para":{"mid":10000}
|
||||
},
|
||||
"waveStart":{
|
||||
"type":"waveStart",
|
||||
"des":"进入波次触发",
|
||||
"para":{
|
||||
"team":2,
|
||||
"wave":2
|
||||
}
|
||||
},
|
||||
"useSkill":{
|
||||
"type":"useSkill",
|
||||
"des":"每num个技能时",
|
||||
"para":{
|
||||
"team":1,
|
||||
"num":1
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public function BattleTriggerType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package net.pixvi.myr.element.battle.trigger.triggereffect
|
||||
{
|
||||
public class BaseTriggerEffect
|
||||
{
|
||||
|
||||
public var id:String;
|
||||
|
||||
public var type:String;
|
||||
|
||||
public var para:Object;
|
||||
|
||||
public var completed:Boolean = false;
|
||||
|
||||
public function BaseTriggerEffect(o:Object)
|
||||
{
|
||||
super();
|
||||
this.id = o.id;
|
||||
this.type = o.type;
|
||||
this.para = o.para;
|
||||
}
|
||||
|
||||
public function start() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function complete() : void
|
||||
{
|
||||
this.completed = true;
|
||||
}
|
||||
|
||||
public function step() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function pause() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function stop() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function resume() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package net.pixvi.myr.element.battle.trigger.triggereffect
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
|
||||
public class DelayTriggerEffect extends BaseTriggerEffect
|
||||
{
|
||||
|
||||
public var func:Function;
|
||||
|
||||
public var funcpara:Array;
|
||||
|
||||
public var timer:Cooldowner;
|
||||
|
||||
public var mondeadcheck:BattleMon;
|
||||
|
||||
public function DelayTriggerEffect(o:Object)
|
||||
{
|
||||
super(o);
|
||||
}
|
||||
|
||||
public function init(time:int = 1000, func:Function = null, para:Array = null, mondeadcheck:BattleMon = null) : void
|
||||
{
|
||||
timer = new Cooldowner(time);
|
||||
timer.activity();
|
||||
this.mondeadcheck = mondeadcheck;
|
||||
this.func = func;
|
||||
this.funcpara = para;
|
||||
}
|
||||
|
||||
override public function step() : void
|
||||
{
|
||||
if(timer.cooldown)
|
||||
{
|
||||
complete();
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
timer.pause();
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
timer.resume();
|
||||
}
|
||||
|
||||
override public function stop() : void
|
||||
{
|
||||
timer.pause();
|
||||
}
|
||||
|
||||
override public function complete() : void
|
||||
{
|
||||
if(mondeadcheck == null || !mondeadcheck.monVo.dead)
|
||||
{
|
||||
func.apply(this,funcpara);
|
||||
}
|
||||
super.complete();
|
||||
mondeadcheck = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,420 @@
|
||||
package net.pixvi.myr.element.boss
|
||||
{
|
||||
import net.pixvi.myr.center.BossCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.center.TimeCenter;
|
||||
import net.pixvi.myr.element.cost.CostVo;
|
||||
import net.pixvi.myr.element.reward.RewardVo;
|
||||
import net.pixvi.myr.util.MyrCalendar;
|
||||
import net.pixvi.pfw.utils.Counter;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
|
||||
public class BossVo
|
||||
{
|
||||
|
||||
public var bossId:String = "1001";
|
||||
|
||||
public var name:String = "";
|
||||
|
||||
public var totalHp:Number = 1000000000;
|
||||
|
||||
public var currentHp:Number = 0;
|
||||
|
||||
public var showHp:Number = -1;
|
||||
|
||||
public var startTime:Number = 0;
|
||||
|
||||
public var endTime:Number = 0;
|
||||
|
||||
public var getRewardTime:Number = 0;
|
||||
|
||||
public var getReward:Boolean = false;
|
||||
|
||||
public var huntTime:Number = 0;
|
||||
|
||||
public var damage:Number = 0;
|
||||
|
||||
public var huntNumCount:int = 0;
|
||||
|
||||
public var damageCount:Number = 0;
|
||||
|
||||
public var prevLocalCheckTime:Number;
|
||||
|
||||
public var noticed:Boolean = false;
|
||||
|
||||
public var preNoticed:Boolean = false;
|
||||
|
||||
public var updateOver:Boolean = false;
|
||||
|
||||
public var status:int = 0;
|
||||
|
||||
public var gotoReward:Boolean = false;
|
||||
|
||||
public function BossVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function table() : Object
|
||||
{
|
||||
return Table.boss_info[bossId];
|
||||
}
|
||||
|
||||
public function get des() : String
|
||||
{
|
||||
return table().des;
|
||||
}
|
||||
|
||||
public function get overMsg() : String
|
||||
{
|
||||
return table().overMsg;
|
||||
}
|
||||
|
||||
public function get rewardImg() : String
|
||||
{
|
||||
return table().rewardImg;
|
||||
}
|
||||
|
||||
public function get helpScript() : String
|
||||
{
|
||||
return table().helpScript;
|
||||
}
|
||||
|
||||
public function get maxNum() : int
|
||||
{
|
||||
return table().maxNum;
|
||||
}
|
||||
|
||||
public function get preNotice() : String
|
||||
{
|
||||
return (table().preNotice as String).replace("{name}",Paster.font(name,"#ffcc00"));
|
||||
}
|
||||
|
||||
public function get notice() : String
|
||||
{
|
||||
return (table().notice as String).replace("{name}",Paster.font(name,"#ffcc00"));
|
||||
}
|
||||
|
||||
public function getLeftNum() : int
|
||||
{
|
||||
var n:int = int((TimeCenter.timestamp - huntTime) / cd);
|
||||
if(n > maxNum)
|
||||
{
|
||||
n = maxNum;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
public function get maxDamage() : Number
|
||||
{
|
||||
return table().maxDamage;
|
||||
}
|
||||
|
||||
public function get cd() : int
|
||||
{
|
||||
return table().cd;
|
||||
}
|
||||
|
||||
public function get battleCost() : CostVo
|
||||
{
|
||||
var co:CostVo = new CostVo();
|
||||
co.setByVo(table().battleCost);
|
||||
return co;
|
||||
}
|
||||
|
||||
public function get battleReward() : RewardVo
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public function get element() : int
|
||||
{
|
||||
return table().element;
|
||||
}
|
||||
|
||||
public function get totalDamageReward() : Array
|
||||
{
|
||||
return totalDamageReward;
|
||||
}
|
||||
|
||||
public function getRewardByTotalDamage(totalDamage:Number) : RewardVo
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public function get position() : Object
|
||||
{
|
||||
if(table() == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return table().position;
|
||||
}
|
||||
|
||||
public function setData(data:Object) : void
|
||||
{
|
||||
this.bossId = data.bossId;
|
||||
this.name = data.name;
|
||||
this.totalHp = data.totalHp;
|
||||
this.currentHp = this.showHp = data.currentHp;
|
||||
this.startTime = int(data.startTime / 1000);
|
||||
this.endTime = int(data.endTime / 1000);
|
||||
}
|
||||
|
||||
public function setHuntInfo(data:Object = null) : void
|
||||
{
|
||||
if(data == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.huntTime = int(data.huntTime / 1000);
|
||||
this.getRewardTime = int(data.getRewardTime / 1000);
|
||||
this.getReward = data.getReward == 1;
|
||||
this.damage = data.damage;
|
||||
}
|
||||
|
||||
public function get isGetReward() : Boolean
|
||||
{
|
||||
return MyrCalendar.getDayNumber(getRewardTime * 1000) == MyrCalendar.getDayNumber();
|
||||
}
|
||||
|
||||
public function get closeMsg() : String
|
||||
{
|
||||
return table().closeMsg;
|
||||
}
|
||||
|
||||
public function get pointMsg() : String
|
||||
{
|
||||
return table().pointMsg;
|
||||
}
|
||||
|
||||
public function get pointName() : String
|
||||
{
|
||||
return table().pointName;
|
||||
}
|
||||
|
||||
public function getImg() : String
|
||||
{
|
||||
return table().battle[getMode()].img;
|
||||
}
|
||||
|
||||
public function getWildImg() : void
|
||||
{
|
||||
return table().wildImg;
|
||||
}
|
||||
|
||||
public function getMode() : int
|
||||
{
|
||||
var i:int = 0;
|
||||
var sc:Number = currentHp / totalHp;
|
||||
for(i = 0; i < table().battle.length; )
|
||||
{
|
||||
if(sc >= table().battle[i].process)
|
||||
{
|
||||
return table().battle[i].mode;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return 3;
|
||||
}
|
||||
|
||||
public function getShowMode() : int
|
||||
{
|
||||
var i:int = 0;
|
||||
var sc:Number = showHp / totalHp;
|
||||
for(i = 0; i < table().battle.length; )
|
||||
{
|
||||
if(sc >= table().battle[i].process)
|
||||
{
|
||||
return table().battle[i].mode;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return 3;
|
||||
}
|
||||
|
||||
public function hasDamage() : Boolean
|
||||
{
|
||||
if(MyrCalendar.getDayNumber() != MyrCalendar.getDayNumber(huntTime * 1000))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function hasGetReward() : Boolean
|
||||
{
|
||||
if(MyrCalendar.getDay(getRewardTime) == MyrCalendar.getDay())
|
||||
{
|
||||
return getReward;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isOver() : Boolean
|
||||
{
|
||||
if(TimeCenter.timestamp > endTime)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get linkBoss() : Array
|
||||
{
|
||||
return table().linkBoss;
|
||||
}
|
||||
|
||||
public function isShow() : Boolean
|
||||
{
|
||||
var i:int = 0;
|
||||
var linkb:BossVo = null;
|
||||
for(i = 0; i < linkBoss.length; )
|
||||
{
|
||||
linkb = BossCenter.getIns().getBossByBossId(linkBoss[i]);
|
||||
if(linkb.currentHp >= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(isOver())
|
||||
{
|
||||
if(hasDamage())
|
||||
{
|
||||
if(getReward)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if(TimeCenter.timestamp <= endTime && TimeCenter.timestamp >= startTime)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function cdLeft() : int
|
||||
{
|
||||
return cd - (TimeCenter.timestamp - huntTime) % cd;
|
||||
}
|
||||
|
||||
public function getHpScale() : Number
|
||||
{
|
||||
var startValue:Number = NaN;
|
||||
var curMode:int = getMode();
|
||||
if(curMode == 3)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if(curMode == 0)
|
||||
{
|
||||
startValue = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
startValue = Number(table().battle[curMode - 1].process);
|
||||
}
|
||||
var endValue:Number = Number(table().battle[curMode].process);
|
||||
return Counter.getAreaByArea(0,1,startValue,endValue,currentHp / totalHp,true);
|
||||
}
|
||||
|
||||
public function get finishTitle() : String
|
||||
{
|
||||
return table().finishTitle;
|
||||
}
|
||||
|
||||
public function get finishContent() : String
|
||||
{
|
||||
return table().finishContent;
|
||||
}
|
||||
|
||||
public function getShowHpScale() : Number
|
||||
{
|
||||
var startValue:Number = NaN;
|
||||
var curMode:Number = getShowMode();
|
||||
if(curMode == 0)
|
||||
{
|
||||
startValue = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
startValue = Number(table().battle[curMode - 1].process);
|
||||
}
|
||||
var endValue:Number = Number(table().battle[curMode].process);
|
||||
return Counter.getAreaByArea(0,1,startValue,endValue,showHp / totalHp,true);
|
||||
}
|
||||
|
||||
public function costTi() : int
|
||||
{
|
||||
return table().battleCost.ti;
|
||||
}
|
||||
|
||||
public function getCurBattle() : Object
|
||||
{
|
||||
var mode:int = getMode();
|
||||
for each(var o:Object in table().battle)
|
||||
{
|
||||
if(o.mode == mode)
|
||||
{
|
||||
return o.battle;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function get hitMovs() : Array
|
||||
{
|
||||
return table().hitMov;
|
||||
}
|
||||
|
||||
public function needNotice() : Boolean
|
||||
{
|
||||
if(TimeCenter.timestamp >= startTime && TimeCenter.timestamp <= endTime)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function finishLink() : Boolean
|
||||
{
|
||||
var i:int = 0;
|
||||
var linkb:BossVo = null;
|
||||
for(i = 0; i < linkBoss.length; )
|
||||
{
|
||||
linkb = BossCenter.getIns().getBossByBossId(linkBoss[i]);
|
||||
if(linkb.currentHp >= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function needPreNotice() : Boolean
|
||||
{
|
||||
if(TimeCenter.timestamp >= startTime - 3600 * 0.5 && TimeCenter.timestamp < startTime)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get rankId() : String
|
||||
{
|
||||
return table().rankId;
|
||||
}
|
||||
|
||||
public function getDamageMsg(bossDamage:int) : String
|
||||
{
|
||||
var msg:String = table().damageMsg;
|
||||
return msg.replace("{damage}",Paster.font(bossDamage.toString(),"#ffcc00"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
package net.pixvi.myr.element.city
|
||||
{
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class CityVo
|
||||
{
|
||||
|
||||
public var cid:int;
|
||||
|
||||
public function CityVo(id:int)
|
||||
{
|
||||
super();
|
||||
cid = id;
|
||||
}
|
||||
|
||||
public static function checkUnlock(city:int) : Boolean
|
||||
{
|
||||
if(Table.city_info[city].hide == true)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return Master.history.unlockCity[city];
|
||||
}
|
||||
|
||||
public function get name() : String
|
||||
{
|
||||
return table().name;
|
||||
}
|
||||
|
||||
public function get hasMine() : Boolean
|
||||
{
|
||||
return Table.mine_info.cityMine[cid.toString()] != null;
|
||||
}
|
||||
|
||||
public function wildArea() : String
|
||||
{
|
||||
if(table().wildArea != null && table().wildArea != "")
|
||||
{
|
||||
return table().wildArea;
|
||||
}
|
||||
return table().cid;
|
||||
}
|
||||
|
||||
public function get openExtraModeOpen() : Boolean
|
||||
{
|
||||
if(table().openExtraModeStage == null || table().openExtraModeStage == "" || Master.history.passStage[table().openExtraModeStage] != null && Master.history.passStage[table().openExtraModeStage]["1"] == true)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get openHardModeOpen() : Boolean
|
||||
{
|
||||
if(table().openHardModeStage == null || table().openHardModeStage == "" || Master.history.passStage[table().openHardModeStage] != null && Master.history.passStage[table().openHardModeStage]["1"] == true)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get wildDes() : String
|
||||
{
|
||||
return table().wild;
|
||||
}
|
||||
|
||||
public function get des() : String
|
||||
{
|
||||
return table().des;
|
||||
}
|
||||
|
||||
public function get barDes() : String
|
||||
{
|
||||
return table().bar;
|
||||
}
|
||||
|
||||
public function get marketDes() : String
|
||||
{
|
||||
return table().market;
|
||||
}
|
||||
|
||||
public function get alchemyDes() : String
|
||||
{
|
||||
return table().alchemy;
|
||||
}
|
||||
|
||||
public function get xiehuiDes() : String
|
||||
{
|
||||
return table().xiehui;
|
||||
}
|
||||
|
||||
public function get country() : int
|
||||
{
|
||||
return table().country;
|
||||
}
|
||||
|
||||
public function get imgSrc() : String
|
||||
{
|
||||
return "data/img/bg/bg_city_" + cid + ".jpg";
|
||||
}
|
||||
|
||||
public function get imgTitle() : String
|
||||
{
|
||||
return "data/img/city/title_city" + cid + ".png";
|
||||
}
|
||||
|
||||
public function get marketOpenSnd() : String
|
||||
{
|
||||
if(table().marketOpenSnd == null)
|
||||
{
|
||||
return "marketOpen";
|
||||
}
|
||||
return table().marketOpenSnd;
|
||||
}
|
||||
|
||||
public function get cityShadowImg() : String
|
||||
{
|
||||
return table().cityShadowImg;
|
||||
}
|
||||
|
||||
public function get cityShadowImgFloatX() : int
|
||||
{
|
||||
return table().cityShadowImgFloatX;
|
||||
}
|
||||
|
||||
public function get cityShadowImgFloatY() : int
|
||||
{
|
||||
return table().cityShadowImgFloatY;
|
||||
}
|
||||
|
||||
public function get xiehuiImg() : String
|
||||
{
|
||||
return table().xiehuiImg;
|
||||
}
|
||||
|
||||
public function get xiehuiImgFloatX() : int
|
||||
{
|
||||
return table().xiehuiImgFloatX;
|
||||
}
|
||||
|
||||
public function get xiehuiImgFloatY() : int
|
||||
{
|
||||
return table().xiehuiImgFloatY;
|
||||
}
|
||||
|
||||
public function get marketBuyStory() : String
|
||||
{
|
||||
if(table().marketBuyStory == null)
|
||||
{
|
||||
return "sys_market_" + Random.integer(1,2);
|
||||
}
|
||||
return table().marketBuyStory;
|
||||
}
|
||||
|
||||
public function get xiehuiBgImg() : String
|
||||
{
|
||||
if(table().xiehuiBgImg == null)
|
||||
{
|
||||
return "/data/img/bg/bg_3.jpg";
|
||||
}
|
||||
return table().xiehuiBgImg;
|
||||
}
|
||||
|
||||
public function get shichangBgImg() : String
|
||||
{
|
||||
if(table().shichangBgImg == null)
|
||||
{
|
||||
return "/data/img/bg/bg_2.jpg";
|
||||
}
|
||||
return table().shichangBgImg;
|
||||
}
|
||||
|
||||
public function table() : Object
|
||||
{
|
||||
return Table.city_info[cid];
|
||||
}
|
||||
|
||||
public function unlock() : Boolean
|
||||
{
|
||||
return checkUnlock(cid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
package net.pixvi.myr.element.cost
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.reward.RewardType;
|
||||
|
||||
public class CostShowVo
|
||||
{
|
||||
|
||||
public var type:String = "";
|
||||
|
||||
public var typeId:int;
|
||||
|
||||
public var num:int = 1;
|
||||
|
||||
public function CostShowVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function get quality() : int
|
||||
{
|
||||
if(type == CostType.KE || type == CostType.MONEY || type == CostType.TI)
|
||||
{
|
||||
return RewardType.qualityDic[type];
|
||||
}
|
||||
if(type == "item")
|
||||
{
|
||||
return ItemVo.getQuality(typeId);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
public function get imgSrc() : String
|
||||
{
|
||||
if(type == CostType.KE || type == CostType.MONEY || type == CostType.TI)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case RewardType.MONEY:
|
||||
return "data/img/item/item_money.png";
|
||||
case RewardType.KE:
|
||||
return "data/img/item/item_ke.png";
|
||||
case RewardType.TI:
|
||||
return "data/img/item/item_ti.png";
|
||||
}
|
||||
}
|
||||
else if(type == "item")
|
||||
{
|
||||
return ItemVo.getImgSrc(typeId);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public function get name() : String
|
||||
{
|
||||
if(type == CostType.KE || type == CostType.MONEY || type == CostType.TI)
|
||||
{
|
||||
return RewardType.nameDic[type];
|
||||
}
|
||||
if(type == "item")
|
||||
{
|
||||
return ItemVo.getName(typeId);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public function get tip() : String
|
||||
{
|
||||
var tip:String = name;
|
||||
if(type == "item" && ItemVo.getFrom(typeId) != null)
|
||||
{
|
||||
tip += "<br/>" + lang("获取途径:") + ItemVo.getFrom(typeId);
|
||||
}
|
||||
return tip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package net.pixvi.myr.element.cost
|
||||
{
|
||||
public class CostType
|
||||
{
|
||||
|
||||
public static var MONEY:String = "money";
|
||||
|
||||
public static const MONSTER:String = "monster";
|
||||
|
||||
public static const ITEM:String = "item";
|
||||
|
||||
public static var KE:String = "ke";
|
||||
|
||||
public static var TI:String = "ti";
|
||||
|
||||
public function CostType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package net.pixvi.myr.element.cost
|
||||
{
|
||||
import net.pixvi.myr.element.reward.RewardType;
|
||||
import net.pixvi.pfw.utils.Mapper;
|
||||
|
||||
public class CostVo
|
||||
{
|
||||
|
||||
public var money:int = 0;
|
||||
|
||||
public var ke:int = 0;
|
||||
|
||||
public var ti:int = 0;
|
||||
|
||||
public var items:Array = [];
|
||||
|
||||
public var monsters:Array = [];
|
||||
|
||||
public function CostVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function setByVo(datavo:Object) : void
|
||||
{
|
||||
Mapper.fillVariables(this,datavo);
|
||||
}
|
||||
|
||||
public function getShowArray(showMoney:Boolean = false, showKe:Boolean = false, showTi:Boolean = false, exceptItemType:String = null) : Array
|
||||
{
|
||||
var showvo1:CostShowVo = null;
|
||||
var showvo2:CostShowVo = null;
|
||||
var showvo3:CostShowVo = null;
|
||||
var i:int = 0;
|
||||
var showvo:CostShowVo = null;
|
||||
var array:Array = [];
|
||||
if(showMoney && money > 0)
|
||||
{
|
||||
showvo1 = new CostShowVo();
|
||||
showvo1.type = RewardType.MONEY;
|
||||
showvo1.num = money;
|
||||
array.push(showvo1);
|
||||
}
|
||||
if(showKe && ke > 0)
|
||||
{
|
||||
showvo2 = new CostShowVo();
|
||||
showvo2.type = RewardType.KE;
|
||||
showvo2.num = ke;
|
||||
array.push(showvo2);
|
||||
}
|
||||
if(showTi && ti > 0)
|
||||
{
|
||||
showvo3 = new CostShowVo();
|
||||
showvo3.type = RewardType.TI;
|
||||
showvo3.num = ti;
|
||||
array.push(showvo3);
|
||||
}
|
||||
for(i = 0; i < items.length; )
|
||||
{
|
||||
if(!(exceptItemType != null && exceptItemType == items[i].typeId.toString()))
|
||||
{
|
||||
showvo = new CostShowVo();
|
||||
showvo.type = "item";
|
||||
showvo.num = items[i].num;
|
||||
showvo.typeId = items[i].typeId;
|
||||
array.push(showvo);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
package net.pixvi.myr.element.explore
|
||||
{
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.StageCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.reward.RewardVo;
|
||||
|
||||
public class ExploreAreaVo
|
||||
{
|
||||
|
||||
public var area:String;
|
||||
|
||||
public function ExploreAreaVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function get reward() : RewardVo
|
||||
{
|
||||
var r:RewardVo = new RewardVo();
|
||||
r.setByObject(table.reward);
|
||||
return r;
|
||||
}
|
||||
|
||||
public function passStage() : String
|
||||
{
|
||||
return table.passStage;
|
||||
}
|
||||
|
||||
public function enemys() : Array
|
||||
{
|
||||
return table.enemys;
|
||||
}
|
||||
|
||||
public function items() : Array
|
||||
{
|
||||
return table.items;
|
||||
}
|
||||
|
||||
public function name() : String
|
||||
{
|
||||
return table.name;
|
||||
}
|
||||
|
||||
public function des() : String
|
||||
{
|
||||
return table.des;
|
||||
}
|
||||
|
||||
public function get level() : Array
|
||||
{
|
||||
return table.level;
|
||||
}
|
||||
|
||||
public function get costTi() : int
|
||||
{
|
||||
return table.costTi;
|
||||
}
|
||||
|
||||
public function get costTime() : int
|
||||
{
|
||||
return table.costTime;
|
||||
}
|
||||
|
||||
public function get unlock() : Boolean
|
||||
{
|
||||
if(StageCenter.getIns().isStagePass(table.passStage))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get exploreing() : Boolean
|
||||
{
|
||||
var i:int = 0;
|
||||
var team:ExploreTeamVo = null;
|
||||
for(i = 0; i < Master.exploreTeams.length; )
|
||||
{
|
||||
team = Master.exploreTeams[i];
|
||||
if(team.area == area && team.status == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get table() : Object
|
||||
{
|
||||
return Table.explore_info[area];
|
||||
}
|
||||
|
||||
public function get loopBg() : String
|
||||
{
|
||||
return table.loopBg;
|
||||
}
|
||||
|
||||
public function get titleBg() : String
|
||||
{
|
||||
return table.titleBg;
|
||||
}
|
||||
|
||||
public function getImgA() : String
|
||||
{
|
||||
return "data/img/bg/loopbg_" + loopBg + "a.jpg";
|
||||
}
|
||||
|
||||
public function getImgB() : String
|
||||
{
|
||||
return "data/img/bg/loopbg_" + loopBg + "b.jpg";
|
||||
}
|
||||
|
||||
public function getIcon() : String
|
||||
{
|
||||
return "data/img/common/explor_map" + titleBg + ".png";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package net.pixvi.myr.element.explore
|
||||
{
|
||||
public class ExploreStoryEventVo
|
||||
{
|
||||
|
||||
public var time:uint;
|
||||
|
||||
public var text:String = "";
|
||||
|
||||
public var itemFlag:int = -1;
|
||||
|
||||
public var monId:Number = 0;
|
||||
|
||||
public var face:int = -1;
|
||||
|
||||
public function ExploreStoryEventVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,339 @@
|
||||
package net.pixvi.myr.element.explore
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.CP;
|
||||
import net.pixvi.myr.center.MonsterCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.center.TimeCenter;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.pfw.utils.SeedRandom;
|
||||
|
||||
public class ExploreStoryVo
|
||||
{
|
||||
|
||||
public var team:ExploreTeamVo;
|
||||
|
||||
public var area:ExploreAreaVo;
|
||||
|
||||
public var events:Array;
|
||||
|
||||
public var rewards:Array;
|
||||
|
||||
public var builded:Boolean = false;
|
||||
|
||||
public function ExploreStoryVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function buildEvents() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var mon:MonsterVo = null;
|
||||
var oi:int = 0;
|
||||
var j:int = 0;
|
||||
var re:Object = null;
|
||||
var isBattle:Boolean = false;
|
||||
var ranFinder:MonsterVo = null;
|
||||
var starttime:* = 0;
|
||||
var enemy:String = null;
|
||||
var battleevo2:ExploreStoryEventVo = null;
|
||||
var battleevo:ExploreStoryEventVo = null;
|
||||
var battleevo3:ExploreStoryEventVo = null;
|
||||
var winner:MonsterVo = null;
|
||||
var battleevo4:ExploreStoryEventVo = null;
|
||||
var battleevo5:ExploreStoryEventVo = null;
|
||||
var ranPos:String = null;
|
||||
var findvo2:ExploreStoryEventVo = null;
|
||||
var findvo:ExploreStoryEventVo = null;
|
||||
var findvo3:ExploreStoryEventVo = null;
|
||||
var tiemon:MonsterVo = null;
|
||||
var tievo:ExploreStoryEventVo = null;
|
||||
var tievo2:ExploreStoryEventVo = null;
|
||||
var inMon:MonsterVo = null;
|
||||
var tievo3:ExploreStoryEventVo = null;
|
||||
if(builded)
|
||||
{
|
||||
return;
|
||||
}
|
||||
builded = true;
|
||||
var flag:int = 0;
|
||||
var mons:Array = [];
|
||||
var storys:Array = [];
|
||||
for(i = 0; i < team.monsters.length; )
|
||||
{
|
||||
mon = MonsterCenter.getIns().getMonById(team.monsters[i]);
|
||||
mons[i] = mon;
|
||||
i++;
|
||||
}
|
||||
rewards = team.reward.getItems();
|
||||
rewards = rewards.concat(team.reward.getMonsters());
|
||||
for(oi = 0; i < rewards.length; )
|
||||
{
|
||||
if(rewards[oi] is ItemVo)
|
||||
{
|
||||
if((rewards[oi] as ItemVo).type == 20015)
|
||||
{
|
||||
rewards.splice(oi,1);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
var e1:ExploreStoryEventVo = new ExploreStoryEventVo();
|
||||
e1.time = team.startTime + 5;
|
||||
e1.text = getMonText(mons[0],"start","ld",team.getSeed(1));
|
||||
e1.monId = mons[0].id;
|
||||
e1.face = 6;
|
||||
storys.push(e1);
|
||||
var e2:ExploreStoryEventVo = new ExploreStoryEventVo();
|
||||
e2.time = team.startTime + 11;
|
||||
var e2Mon:MonsterVo = SeedRandom.element([mons[1],mons[2]],team.getSeed(2)) as MonsterVo;
|
||||
e2.text = getMonText(e2Mon,"start","mb",team.getSeed(3));
|
||||
e2.monId = e2Mon.id;
|
||||
e2.face = 12;
|
||||
storys.push(e2);
|
||||
var e3:ExploreStoryEventVo = new ExploreStoryEventVo();
|
||||
e3.time = team.startTime + 41;
|
||||
e3.text = lang("探险小队来到了 {0}",area.name());
|
||||
if(team.getSeed(6) < 0.5)
|
||||
{
|
||||
e3.face = 12;
|
||||
}
|
||||
storys.push(e3);
|
||||
for(j = 0; j < rewards.length; )
|
||||
{
|
||||
re = rewards[j];
|
||||
isBattle = team.getSeed(j + 34) < 0.4;
|
||||
ranFinder = SeedRandom.element(mons,team.getSeed(j + 14)) as MonsterVo;
|
||||
starttime = uint(team.startTime + 60 + j * (team.endTime - team.startTime - 60) / (rewards.length + 1));
|
||||
if(isBattle)
|
||||
{
|
||||
enemy = SeedRandom.element(area.enemys(),team.getSeed(j + 24)).toString();
|
||||
battleevo2 = new ExploreStoryEventVo();
|
||||
battleevo2.time = starttime + 4;
|
||||
if(team.getSeed(j + 26) < 0.5)
|
||||
{
|
||||
battleevo2.text = lang("一群 {0} 突然跳了出来!<br/>与 {1} 发生了战斗!",CP.red(enemy),CP.red(enemy));
|
||||
battleevo2.face = 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
battleevo2.text = lang("探险队找到了 {0} 的巢穴!<br/>与 {1} 发生了战斗!",CP.red(enemy),CP.red(enemy));
|
||||
battleevo2.face = 15;
|
||||
}
|
||||
storys.push(battleevo2);
|
||||
battleevo = new ExploreStoryEventVo();
|
||||
battleevo.time = starttime + 10;
|
||||
battleevo.text = getMonText(ranFinder,"enemy",ranFinder == mons[0] ? "ld" : "mb",team.getSeed(j + 25));
|
||||
battleevo.monId = ranFinder.id;
|
||||
battleevo.face = 6;
|
||||
storys.push(battleevo);
|
||||
battleevo3 = new ExploreStoryEventVo();
|
||||
battleevo3.time = starttime + 57;
|
||||
winner = SeedRandom.element(mons,team.getSeed(j + 27)) as MonsterVo;
|
||||
if(team.getSeed(j + 28) < 0.5)
|
||||
{
|
||||
battleevo3.text = lang("{0} 击倒了最后一只{1}!",CP.lightYellow(winner.name),CP.red(enemy));
|
||||
}
|
||||
else
|
||||
{
|
||||
battleevo3.text = lang("在 {0} 的帮助下,大家打跑了{1}!",CP.lightYellow(winner.name),CP.red(enemy));
|
||||
}
|
||||
if(team.getSeed(18) < 0.5)
|
||||
{
|
||||
battleevo3.face = 12;
|
||||
}
|
||||
storys.push(battleevo3);
|
||||
battleevo4 = new ExploreStoryEventVo();
|
||||
battleevo4.time = starttime + 65;
|
||||
battleevo4.text = getMonText(winner,"win",winner == mons[0] ? "ld" : "mb",team.getSeed(j + 31));
|
||||
battleevo4.monId = winner.id;
|
||||
battleevo4.face = 6;
|
||||
storys.push(battleevo4);
|
||||
battleevo5 = new ExploreStoryEventVo();
|
||||
battleevo5.time = starttime + 67;
|
||||
battleevo5.text = lang("获得了 {0} 个 {1}",CP.gold(re.num),CP.gold(re.name));
|
||||
battleevo5.itemFlag = j;
|
||||
storys.push(battleevo5);
|
||||
}
|
||||
else
|
||||
{
|
||||
ranPos = Paster.font(SeedRandom.element(area.items(),team.getSeed(j + 12)).toString(),"#2c4883");
|
||||
findvo2 = new ExploreStoryEventVo();
|
||||
findvo2.time = starttime + 4;
|
||||
findvo2.text = lang("发现了一个 {0}",ranPos);
|
||||
storys.push(findvo2);
|
||||
findvo = new ExploreStoryEventVo();
|
||||
findvo.time = starttime + 57;
|
||||
findvo.text = getMonText(ranFinder,"find",ranFinder == mons[0] ? "ld" : "mb",team.getSeed(j + 11));
|
||||
findvo.monId = ranFinder.id;
|
||||
if(team.getSeed(21) < 0.5)
|
||||
{
|
||||
findvo.face = 13;
|
||||
}
|
||||
else
|
||||
{
|
||||
findvo.face = 4;
|
||||
}
|
||||
storys.push(findvo);
|
||||
findvo3 = new ExploreStoryEventVo();
|
||||
findvo3.time = starttime + 65;
|
||||
findvo3.text = lang("在 {0} 中找到了 {1} 个 {2}",ranPos,CP.gold(re.num),CP.gold(re.name));
|
||||
findvo3.itemFlag = j;
|
||||
findvo3.face = 2;
|
||||
storys.push(findvo3);
|
||||
}
|
||||
if(j % 2 == 0 && team.getSeed(j + 34) < 0.5)
|
||||
{
|
||||
tiemon = SeedRandom.element([mons[1],mons[2]],team.getSeed(j + 71)) as MonsterVo;
|
||||
tievo = new ExploreStoryEventVo();
|
||||
tievo.time = starttime + 85;
|
||||
tievo.text = getMonText(tiemon,"tired","mb",team.getSeed(j + 72));
|
||||
if(team.getSeed(133) < 0.5)
|
||||
{
|
||||
tievo.face = 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
tievo.face = 13;
|
||||
}
|
||||
tievo.monId = tiemon.id;
|
||||
storys.push(tievo);
|
||||
tievo2 = new ExploreStoryEventVo();
|
||||
tievo2.time = starttime + 95;
|
||||
tievo2.text = getMonText(mons[0],"inspire","ld",team.getSeed(j + 73));
|
||||
tievo2.monId = mons[0].id;
|
||||
tievo2.face = 12;
|
||||
storys.push(tievo2);
|
||||
if(team.getSeed(j + 35) < 0.5)
|
||||
{
|
||||
inMon = SeedRandom.element([mons[1],mons[2]],team.getSeed(j + 72)) as MonsterVo;
|
||||
tievo3 = new ExploreStoryEventVo();
|
||||
tievo3.time = starttime + 105;
|
||||
tievo3.text = getMonText(inMon,"inspired","mb",team.getSeed(j + 74));
|
||||
tievo3.monId = inMon.id;
|
||||
tievo3.face = 12;
|
||||
storys.push(tievo3);
|
||||
}
|
||||
}
|
||||
j++;
|
||||
}
|
||||
var eend1:ExploreStoryEventVo = new ExploreStoryEventVo();
|
||||
eend1.time = team.endTime - 14;
|
||||
eend1.text = getMonText(mons[0],"home","ld",team.getSeed(99));
|
||||
eend1.monId = mons[0].id;
|
||||
eend1.face = 11;
|
||||
storys.push(eend1);
|
||||
var eend2:ExploreStoryEventVo = new ExploreStoryEventVo();
|
||||
var eend2Mon:MonsterVo = SeedRandom.element([mons[1],mons[2]],team.getSeed(98)) as MonsterVo;
|
||||
eend2.time = team.endTime - 6;
|
||||
eend2.text = getMonText(eend2Mon,"home","mb",team.getSeed(97));
|
||||
eend2.monId = eend2Mon.id;
|
||||
eend2.face = 6;
|
||||
storys.push(eend2);
|
||||
events = storys;
|
||||
}
|
||||
|
||||
public function getMonText(mon:MonsterVo, textType:String, role:String = "ld", randomSeed:Number = 0.5) : String
|
||||
{
|
||||
var montype:int = mon.type;
|
||||
if(Table.explore_text[montype] == null)
|
||||
{
|
||||
montype = 1001010;
|
||||
}
|
||||
if((Table.explore_text[montype][textType][role] as Array).length == 0)
|
||||
{
|
||||
return "...";
|
||||
}
|
||||
return SeedRandom.element(Table.explore_text[montype][textType][role] as Array,randomSeed).toString();
|
||||
}
|
||||
|
||||
public function curTag() : int
|
||||
{
|
||||
var i:int = 0;
|
||||
var e:ExploreStoryEventVo = null;
|
||||
for(i = 0; i < events.length; )
|
||||
{
|
||||
e = events[i];
|
||||
if(e.time >= TimeCenter.timestamp)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return events.length;
|
||||
}
|
||||
|
||||
public function makeText(all:Boolean = false) : String
|
||||
{
|
||||
var j:int = 0;
|
||||
var i:int = 0;
|
||||
var story:ExploreStoryEventVo = null;
|
||||
var words:String = null;
|
||||
var text:String = "";
|
||||
var mons:Object = {};
|
||||
for(j = 0; j < team.monsters.length; )
|
||||
{
|
||||
mons[team.monsters[j]] = MonsterCenter.getIns().getMonById(team.monsters[j]);
|
||||
j++;
|
||||
}
|
||||
for(i = 0; i < events.length; )
|
||||
{
|
||||
story = events[i];
|
||||
if(!all && story.time > TimeCenter.timestamp)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if(story.monId > 0)
|
||||
{
|
||||
words = story.text;
|
||||
words = Paster.replace(words,"{leaderName}",mons[team.monsters[0]].name);
|
||||
words = Paster.replace(words,"{talkerName}",mons[story.monId].name);
|
||||
words = Paster.replace(words,"{mon1Name}",mons[team.monsters[1]].name);
|
||||
words = Paster.replace(words,"{mon2Name}",mons[team.monsters[2]].name);
|
||||
words = Paster.replace(words,"{areaName}",area.name());
|
||||
if(story.monId == mons[team.monsters[1]].id)
|
||||
{
|
||||
words = Paster.replace(words,"{monOtherName}",mons[team.monsters[2]].name);
|
||||
}
|
||||
else
|
||||
{
|
||||
words = Paster.replace(words,"{monOtherName}",mons[team.monsters[1]].name);
|
||||
}
|
||||
text += "[" + Paster.timestampFormat(story.time,"hh:mm:ss") + "] " + Paster.font(mons[story.monId].name + ":" + words,"#f6ffb7");
|
||||
}
|
||||
else
|
||||
{
|
||||
text += "[" + Paster.timestampFormat(story.time,"hh:mm:ss") + "] " + story.text;
|
||||
}
|
||||
text += "<br/>";
|
||||
i++;
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
public function makeItem(all:Boolean = false) : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var e:ExploreStoryEventVo = null;
|
||||
var tag:int = 0;
|
||||
for(i = 0; i < events.length; )
|
||||
{
|
||||
e = events[i];
|
||||
if(!all && e.time >= TimeCenter.timestamp)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if(e.itemFlag != -1)
|
||||
{
|
||||
tag = e.itemFlag + 1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return rewards.slice(0,tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package net.pixvi.myr.element.explore
|
||||
{
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.reward.RewardResultVo;
|
||||
|
||||
public class ExploreTeamVo
|
||||
{
|
||||
|
||||
public var id:int;
|
||||
|
||||
public var status:int;
|
||||
|
||||
public var randoms:Array = [];
|
||||
|
||||
public var monsters:Array = [];
|
||||
|
||||
public var area:String;
|
||||
|
||||
public var endTime:uint;
|
||||
|
||||
public var reward:RewardResultVo;
|
||||
|
||||
public var notice:Boolean = false;
|
||||
|
||||
public function ExploreTeamVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function get startTime() : uint
|
||||
{
|
||||
return endTime - allTime();
|
||||
}
|
||||
|
||||
public function allTime() : int
|
||||
{
|
||||
return Table.explore_info[area].costTime;
|
||||
}
|
||||
|
||||
public function getSeed(flag:int) : Number
|
||||
{
|
||||
var num:Number = randoms[flag % 3] * flag;
|
||||
return num - int(num);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
package net.pixvi.myr.element.gacha
|
||||
{
|
||||
import net.pixvi.myr.center.Table;
|
||||
|
||||
public class GachaVo
|
||||
{
|
||||
|
||||
public var id:String;
|
||||
|
||||
public function GachaVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function get name() : String
|
||||
{
|
||||
return table().name;
|
||||
}
|
||||
|
||||
public function get percTip() : String
|
||||
{
|
||||
if(table().chanceTarget != null && Table.gacha_machine[table().chanceTarget].percTip != null)
|
||||
{
|
||||
return Table.gacha_machine[table().chanceTarget].percTip;
|
||||
}
|
||||
return table().percTip;
|
||||
}
|
||||
|
||||
public function getMoney() : int
|
||||
{
|
||||
if(table().getMoney != null)
|
||||
{
|
||||
return table().getMoney;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function get item() : int
|
||||
{
|
||||
if(table().item == null)
|
||||
{
|
||||
table().item = -1;
|
||||
}
|
||||
return table().item;
|
||||
}
|
||||
|
||||
public function get type() : int
|
||||
{
|
||||
return table().type;
|
||||
}
|
||||
|
||||
public function get replace() : String
|
||||
{
|
||||
return table().replace;
|
||||
}
|
||||
|
||||
public function get max() : int
|
||||
{
|
||||
if(table().max == null)
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
return table().max;
|
||||
}
|
||||
|
||||
public function get des() : String
|
||||
{
|
||||
return table().des;
|
||||
}
|
||||
|
||||
public function get money() : int
|
||||
{
|
||||
return table().money;
|
||||
}
|
||||
|
||||
public function get ke() : int
|
||||
{
|
||||
return table().ke;
|
||||
}
|
||||
|
||||
public function get eggs() : Object
|
||||
{
|
||||
return table().eggs;
|
||||
}
|
||||
|
||||
public function get chance() : Array
|
||||
{
|
||||
if(table().chanceTarget != null)
|
||||
{
|
||||
return Table.gacha_machine[table().chanceTarget].chance;
|
||||
}
|
||||
return table().chance;
|
||||
}
|
||||
|
||||
public function get img() : String
|
||||
{
|
||||
return table().img;
|
||||
}
|
||||
|
||||
public function get img_bg() : String
|
||||
{
|
||||
return table().img_bg;
|
||||
}
|
||||
|
||||
public function get freegift() : int
|
||||
{
|
||||
return table().freegift;
|
||||
}
|
||||
|
||||
public function get hideImg() : Boolean
|
||||
{
|
||||
return table().hideImg == true;
|
||||
}
|
||||
|
||||
public function get hideText() : Boolean
|
||||
{
|
||||
return table().hideText == true;
|
||||
}
|
||||
|
||||
public function get getImgBgSrc() : String
|
||||
{
|
||||
return "data/img/gacha/" + this.img_bg + ".png";
|
||||
}
|
||||
|
||||
public function hasImgBg() : Boolean
|
||||
{
|
||||
if(img_bg != null && img_bg != "")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getImgSrc() : String
|
||||
{
|
||||
return "data/img/gacha/" + this.img + ".png";
|
||||
}
|
||||
|
||||
public function table() : Object
|
||||
{
|
||||
return Table.gacha_machine[id];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
package net.pixvi.myr.element.guide
|
||||
{
|
||||
public class GMain
|
||||
{
|
||||
|
||||
public static var firstStory:String = "firstStory";
|
||||
|
||||
public static var makeTeamEnd:String = "mt_e";
|
||||
|
||||
public static var firstTaskEnd:String = "ft_e";
|
||||
|
||||
public static var firstTaskFinishEnd:String = "ftf_e";
|
||||
|
||||
public static var putEggEnd:String = "pe_e";
|
||||
|
||||
public static var speedEggEnd:String = "se_e";
|
||||
|
||||
public static var getMonEnd:String = "gmon_e";
|
||||
|
||||
public static var addMonToTeam:String = "addMonToTeam";
|
||||
|
||||
public static var addMonToTeam2:String = "addMonToTeam2";
|
||||
|
||||
public static var addMonToTeam3:String = "addMonToTeam3";
|
||||
|
||||
public static var addMonToTeam4:String = "addMonToTeam4";
|
||||
|
||||
public static var getFirstTask:String = "getFirstTask";
|
||||
|
||||
public static var battleTeach:String = "battleTeach";
|
||||
|
||||
public static var battleTeach2:String = "battleTeach2";
|
||||
|
||||
public static var finishTask:String = "finishTask";
|
||||
|
||||
public static var finishTask2:String = "finishTask2";
|
||||
|
||||
public static var finishTask3:String = "finishTask3";
|
||||
|
||||
public static var stackMon0:String = "stackMon";
|
||||
|
||||
public static var stackMon1:String = "stackMon1";
|
||||
|
||||
public static var stackMon2:String = "stackMon2";
|
||||
|
||||
public static var stackMon25:String = "stackMon25";
|
||||
|
||||
public static var stackMon3:String = "stackMon3";
|
||||
|
||||
public static var stackMon4:String = "stackMon4";
|
||||
|
||||
public static var stackMon5:String = "stackMon5";
|
||||
|
||||
public static var stackMon6:String = "stackMon6";
|
||||
|
||||
public static var stackMon7:String = "stackMon7";
|
||||
|
||||
public static var stackMon8:String = "stackMon8";
|
||||
|
||||
public static var stackMon85:String = "stackMon85";
|
||||
|
||||
public static var stackMon9:String = "stackMon9";
|
||||
|
||||
public static var goCity0:String = "goCity0";
|
||||
|
||||
public static var goCity1:String = "goCity1";
|
||||
|
||||
public static var goCity2:String = "goCity2";
|
||||
|
||||
public static var goCity3:String = "goCity3";
|
||||
|
||||
public static var goXiehui1:String = "goXiehui";
|
||||
|
||||
public static var goXiehui2:String = "goXiehui2";
|
||||
|
||||
public static var goXiehui3:String = "goXiehui3";
|
||||
|
||||
public static var goXiehui4:String = "goXiehui4";
|
||||
|
||||
public static var finishTaskB:String = "finishTaskB";
|
||||
|
||||
public static var finishTaskB2:String = "finishTaskB2";
|
||||
|
||||
public static var finishTaskB3:String = "finishTaskB3";
|
||||
|
||||
public static var goWild1:String = "goWild1";
|
||||
|
||||
public static var goWild2:String = "goWild2";
|
||||
|
||||
public static var goWild3:String = "goWild3";
|
||||
|
||||
public static var goWildOver:String = "goWildOver";
|
||||
|
||||
public static var Process:Array = [firstStory,addMonToTeam,addMonToTeam2,addMonToTeam3,addMonToTeam4,getFirstTask,battleTeach,finishTask,finishTask2,finishTask3,stackMon0,stackMon1,stackMon2,stackMon25,stackMon3,stackMon4,stackMon5,stackMon6,stackMon7,stackMon8,stackMon85,stackMon9,goCity0,goCity1,goCity2,goCity3,goXiehui1,goXiehui2,goXiehui3,goXiehui4,finishTaskB,finishTaskB2,finishTaskB3,goWild1,goWild2,goWild3,goWildOver];
|
||||
|
||||
public function GMain()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
package net.pixvi.myr.element.guide
|
||||
{
|
||||
public class GSub
|
||||
{
|
||||
|
||||
public static var BUY_EGG1:String = "buyEgg1";
|
||||
|
||||
public static var BUY_EGG2:String = "buyEgg2";
|
||||
|
||||
public static var BUY_EGG3:String = "buyEgg3";
|
||||
|
||||
public static var SELL_MON:String = "sellMon";
|
||||
|
||||
public static var SELL_MON2:String = "sellMon2";
|
||||
|
||||
public static var SELL_MON3:String = "sellMon3";
|
||||
|
||||
public static var START_WILD:String = "startWild";
|
||||
|
||||
public static var TASK_STATUS_FEED_MON:String = "taskFeedMon";
|
||||
|
||||
public static var TASK_STATUS_BUY_EGG:String = "taskBuyEgg";
|
||||
|
||||
public static var TASK_STATUS_BUILD:String = "taskBuild";
|
||||
|
||||
public static var TASK_SELL_MON:String = "taskSellMon";
|
||||
|
||||
public static var FIRST_OUT:String = "firstOut";
|
||||
|
||||
public static var FIRST_FAIL:String = "firstBlood";
|
||||
|
||||
public static var FIRST_FAIL2:String = "firstBlood2";
|
||||
|
||||
public static var FIRST_FAIL3:String = "firstBlood3";
|
||||
|
||||
public static var MINE_FAIL:String = "minefail";
|
||||
|
||||
public static var OPEN_BUILD:String = "openBuild";
|
||||
|
||||
public static var OPEN_MARKET:String = "openMarket";
|
||||
|
||||
public static var OPEN_PVE:String = "openPve";
|
||||
|
||||
public static var OPEN_BAR:String = "openBar";
|
||||
|
||||
public static var OPEN_XIEHUI:String = "openXiehui";
|
||||
|
||||
public static var OPEN_KEGACHA:String = "openKeGacha";
|
||||
|
||||
public static var OPEN_EXPLORE:String = "openExplore";
|
||||
|
||||
public static var OPEN_ALCHEMY:String = "openAlchemy";
|
||||
|
||||
public static var GUIDE_ALCHEMY:String = "galchemy1";
|
||||
|
||||
public static var GUIDE_ALCHEMY2:String = "galchemy2";
|
||||
|
||||
public static var BUILD_READY:String = "buildReady";
|
||||
|
||||
public static var BUILD_OVER:String = "buildOver";
|
||||
|
||||
public static var OPEN_EVENT:String = "openEvent";
|
||||
|
||||
public static var PASS_AREA2:String = "passArea2";
|
||||
|
||||
public static var PASS_AREA3:String = "passArea3";
|
||||
|
||||
public static var PASS_AREA4:String = "passArea4";
|
||||
|
||||
public static var PASS_AREA5:String = "passArea5";
|
||||
|
||||
public static var HARD_MODE:String = "hardMode";
|
||||
|
||||
public static var POTENTIAL_OVER:String = "potential";
|
||||
|
||||
public static var ALCHEMY_OVER:String = "alchemy";
|
||||
|
||||
public static var OPEN_MINE_EXPLORE:String = "openMineExp";
|
||||
|
||||
public static var OPEN_MINE:String = "openMine";
|
||||
|
||||
public static var GUIDE_MINE:String = "gmine1";
|
||||
|
||||
public static var GUIDE_ENTANGLE:String = "gentangle1";
|
||||
|
||||
public static var GUIDE_POTENTIAL:String = "potential1";
|
||||
|
||||
public static var GUIDE_MINE_DIG:String = "guideMineDig";
|
||||
|
||||
public static var OPEN_SHOP:String = "openShop";
|
||||
|
||||
public static var OPEN_MINE_EXCHANGE:String = "opmnex";
|
||||
|
||||
public static var GUIDE_COUNTRY2:String = "ct2";
|
||||
|
||||
public static var ACHI_4C:String = "c4";
|
||||
|
||||
public static var ACHI_5Star:String = "5Star";
|
||||
|
||||
public static var ACHI_4Star:String = "4Star";
|
||||
|
||||
public static var ACHI_VIP:String = "vip";
|
||||
|
||||
public static var ACHI_fullGold:String = "fullGold";
|
||||
|
||||
public function GSub()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package net.pixvi.myr.element.lib
|
||||
{
|
||||
import net.pixvi.common.utils.PiObject;
|
||||
import net.pixvi.myr.center.LibCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
|
||||
public class LibEquipVo extends PiObject
|
||||
{
|
||||
|
||||
public static var q:Array = ["0","C","B","A","S","SS"];
|
||||
|
||||
public var equipType:int;
|
||||
|
||||
public var no:int;
|
||||
|
||||
public function LibEquipVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function get noName() : String
|
||||
{
|
||||
if(part > 3)
|
||||
{
|
||||
return "Z" + no;
|
||||
}
|
||||
return q[quality] + no;
|
||||
}
|
||||
|
||||
public function get quality() : int
|
||||
{
|
||||
return Table.item_info[equipType].quality;
|
||||
}
|
||||
|
||||
public function get part() : int
|
||||
{
|
||||
return Table.item_info[equipType].part;
|
||||
}
|
||||
|
||||
public function get unlock() : Boolean
|
||||
{
|
||||
return LibCenter.getIns().checkEquipUnlock(equipType);
|
||||
}
|
||||
|
||||
public function get recNew() : Boolean
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get sort() : int
|
||||
{
|
||||
if(part > 3)
|
||||
{
|
||||
return quality * 1000000 + no;
|
||||
}
|
||||
return quality * 100000 + no;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package net.pixvi.myr.element.lib
|
||||
{
|
||||
import net.pixvi.common.utils.PiObject;
|
||||
import net.pixvi.myr.center.LibCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.pfw.utils.ArrayUtil;
|
||||
|
||||
public class LibTypeVo extends PiObject
|
||||
{
|
||||
|
||||
public static var newType:Array = [];
|
||||
|
||||
public var monType:int;
|
||||
|
||||
public var no:int = 0;
|
||||
|
||||
public function LibTypeVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function get unlock() : Boolean
|
||||
{
|
||||
return LibCenter.getIns().checkUnlock(monType);
|
||||
}
|
||||
|
||||
public function get recNew() : Boolean
|
||||
{
|
||||
var o:int = newType.indexOf(monType);
|
||||
return newType.indexOf(monType) != -1;
|
||||
}
|
||||
|
||||
public function set recNew(val:Boolean) : void
|
||||
{
|
||||
if(recNew && !val)
|
||||
{
|
||||
ArrayUtil.remove(newType,monType);
|
||||
}
|
||||
}
|
||||
|
||||
public function get sort() : int
|
||||
{
|
||||
return Table.monster_info[monType].sort;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package net.pixvi.myr.element.minigame
|
||||
{
|
||||
public class MiniGameType
|
||||
{
|
||||
|
||||
public static var GAME_RUNNER:int = 1;
|
||||
|
||||
public static var GAME_MOLEHITTER:int = 2;
|
||||
|
||||
public static var GAME_2048:int = 3;
|
||||
|
||||
public static var GAME_BANYUN:int = 4;
|
||||
|
||||
public static var GAME_TAODAE:int = 5;
|
||||
|
||||
public static var GAME_BRICK:int = 6;
|
||||
|
||||
public static var dic:Object = {
|
||||
"0":"无",
|
||||
"1":"逃离追捕",
|
||||
"2":"打地鼠",
|
||||
"3":"2048",
|
||||
"4":"搬运工",
|
||||
"5":"开心套大鹅",
|
||||
"6":"砖块勇者"
|
||||
};
|
||||
|
||||
public function MiniGameType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
package net.pixvi.myr.element.mon
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.center.LibCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
|
||||
public class EggVo extends ItemVo
|
||||
{
|
||||
|
||||
public var timeGet:int;
|
||||
|
||||
public function EggVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function get timeTotal() : int
|
||||
{
|
||||
return monTable().time_1 + monTable().time_2;
|
||||
}
|
||||
|
||||
override public function get name() : String
|
||||
{
|
||||
if(unlock)
|
||||
{
|
||||
return lang("{0}的蛋",monTable().name);
|
||||
}
|
||||
return lang("未知的蛋");
|
||||
}
|
||||
|
||||
public function get desName() : String
|
||||
{
|
||||
return lang("{0}的蛋",monTable().name);
|
||||
}
|
||||
|
||||
public function get star() : int
|
||||
{
|
||||
return monTable().star;
|
||||
}
|
||||
|
||||
public function get element() : int
|
||||
{
|
||||
return monTable().element;
|
||||
}
|
||||
|
||||
override public function get imgsrc() : String
|
||||
{
|
||||
return "data/img/monster/q/" + type + "_q_0.png";
|
||||
}
|
||||
|
||||
override public function get quality() : int
|
||||
{
|
||||
return star;
|
||||
}
|
||||
|
||||
public function buildMonster() : MonsterVo
|
||||
{
|
||||
var mon:MonsterVo = new MonsterVo(type);
|
||||
mon.process = 0;
|
||||
mon.recNewGet = false;
|
||||
mon.buildRandom();
|
||||
mon.timeGet = timeGet;
|
||||
return mon;
|
||||
}
|
||||
|
||||
public function get imgFix() : Object
|
||||
{
|
||||
return monTable().imgFix["0"];
|
||||
}
|
||||
|
||||
public function get unlock() : Boolean
|
||||
{
|
||||
return LibCenter.getIns().checkUnlock(this.type);
|
||||
}
|
||||
|
||||
override public function getQ(q:int = 1) : int
|
||||
{
|
||||
if(quality == q)
|
||||
{
|
||||
return 90000000 + type;
|
||||
}
|
||||
return quality * 10000000 + type;
|
||||
}
|
||||
|
||||
public function monTable() : Object
|
||||
{
|
||||
return Table.monster_info[this.type];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
package net.pixvi.myr.element.mon
|
||||
{
|
||||
import net.pixvi.pfw.utils.PointLocker;
|
||||
|
||||
public class MonsterAdd
|
||||
{
|
||||
|
||||
public var atk:PointLocker;
|
||||
|
||||
public var def:PointLocker;
|
||||
|
||||
public var hp:PointLocker;
|
||||
|
||||
public var dex:PointLocker;
|
||||
|
||||
public var crit:PointLocker;
|
||||
|
||||
public var atkSpd:PointLocker;
|
||||
|
||||
public var atkVim:PointLocker;
|
||||
|
||||
public var selfCure:PointLocker;
|
||||
|
||||
public var deadBoom:PointLocker;
|
||||
|
||||
public var atkStun:PointLocker;
|
||||
|
||||
public var defStun:PointLocker;
|
||||
|
||||
public var atkPoi:PointLocker;
|
||||
|
||||
public var atkPoiDmg:PointLocker;
|
||||
|
||||
public var apCostSave:PointLocker;
|
||||
|
||||
public var skillCooldown:PointLocker;
|
||||
|
||||
public var sunFire:PointLocker;
|
||||
|
||||
public var moonHeal:PointLocker;
|
||||
|
||||
public var thorns:PointLocker;
|
||||
|
||||
public function MonsterAdd()
|
||||
{
|
||||
super();
|
||||
atk = new PointLocker();
|
||||
def = new PointLocker();
|
||||
hp = new PointLocker();
|
||||
dex = new PointLocker();
|
||||
crit = new PointLocker();
|
||||
atkSpd = new PointLocker();
|
||||
atkVim = new PointLocker();
|
||||
selfCure = new PointLocker();
|
||||
deadBoom = new PointLocker();
|
||||
atkStun = new PointLocker();
|
||||
defStun = new PointLocker();
|
||||
atkPoi = new PointLocker();
|
||||
atkPoiDmg = new PointLocker();
|
||||
apCostSave = new PointLocker();
|
||||
skillCooldown = new PointLocker();
|
||||
sunFire = new PointLocker();
|
||||
moonHeal = new PointLocker();
|
||||
thorns = new PointLocker();
|
||||
}
|
||||
|
||||
public function getRecord() : Object
|
||||
{
|
||||
var obj:Object = {};
|
||||
obj.atk = atk.val;
|
||||
obj.def = def.val;
|
||||
obj.hp = hp.val;
|
||||
obj.dex = dex.val;
|
||||
obj.crit = crit.val;
|
||||
obj.atkSpd = atkSpd.val;
|
||||
obj.atkVim = atkVim.val;
|
||||
obj.selfCure = selfCure.val;
|
||||
obj.deadBoom = deadBoom.val;
|
||||
obj.atkStun = atkStun.val;
|
||||
obj.defStun = defStun.val;
|
||||
obj.atkPoi = atkPoi.val;
|
||||
obj.atkPoiDmg = atkPoiDmg.val;
|
||||
obj.apCostSave = apCostSave.val;
|
||||
obj.skillCooldown = skillCooldown.val;
|
||||
obj.sunFire = sunFire.val;
|
||||
obj.moonHeal = moonHeal.val;
|
||||
obj.thorns = thorns.val;
|
||||
return obj;
|
||||
}
|
||||
|
||||
public function update(data:Object) : void
|
||||
{
|
||||
if(data == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
for(var key:String in data)
|
||||
{
|
||||
if(this.hasOwnProperty(key))
|
||||
{
|
||||
this[key].val = data[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package net.pixvi.myr.element.mon
|
||||
{
|
||||
public class MonsterProcess
|
||||
{
|
||||
|
||||
public static const IN_STACK:int = 2;
|
||||
|
||||
public static const IN_ROOM:int = 3;
|
||||
|
||||
public function MonsterProcess()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,200 @@
|
||||
package net.pixvi.myr.element.mon
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.bag.EquipVo;
|
||||
|
||||
public class SkinVo
|
||||
{
|
||||
|
||||
public var typeId:int;
|
||||
|
||||
public var normalMonTypeId:int = 0;
|
||||
|
||||
public function SkinVo(typeId:int, normalMonTypeId:int = 0)
|
||||
{
|
||||
super();
|
||||
this.typeId = typeId;
|
||||
this.normalMonTypeId = normalMonTypeId;
|
||||
}
|
||||
|
||||
public function get name() : String
|
||||
{
|
||||
if(typeId <= 0)
|
||||
{
|
||||
return lang("初始形象");
|
||||
}
|
||||
return table().name;
|
||||
}
|
||||
|
||||
public function get des() : String
|
||||
{
|
||||
if(typeId <= 0)
|
||||
{
|
||||
return lang("魔物没有穿戴时装时的初始形象。");
|
||||
}
|
||||
return table().des;
|
||||
}
|
||||
|
||||
public function get hide() : Boolean
|
||||
{
|
||||
return table().hide;
|
||||
}
|
||||
|
||||
public function get monType() : int
|
||||
{
|
||||
if(typeId <= 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return table().monType;
|
||||
}
|
||||
|
||||
public function get level() : int
|
||||
{
|
||||
if(typeId <= 0)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return table().level;
|
||||
}
|
||||
|
||||
public function get ability() : Object
|
||||
{
|
||||
if(typeId <= 0)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
return table().ability;
|
||||
}
|
||||
|
||||
public function get motou() : Boolean
|
||||
{
|
||||
if(typeId <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return table().motou;
|
||||
}
|
||||
|
||||
public function get showType() : int
|
||||
{
|
||||
if(typeId > 0)
|
||||
{
|
||||
return typeId;
|
||||
}
|
||||
return normalMonTypeId;
|
||||
}
|
||||
|
||||
public function get motouScripts() : Array
|
||||
{
|
||||
if(typeId <= 0)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
return table().motouScripts;
|
||||
}
|
||||
|
||||
public function get voice() : Boolean
|
||||
{
|
||||
if(typeId <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return table().voice;
|
||||
}
|
||||
|
||||
public function get unlockTask() : String
|
||||
{
|
||||
if(typeId <= 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return table().unlockTask;
|
||||
}
|
||||
|
||||
public function get unlock() : Boolean
|
||||
{
|
||||
if(typeId <= 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return Master.history.unlockSkins.indexOf(typeId) >= 0;
|
||||
}
|
||||
|
||||
public function getAbilityDes() : String
|
||||
{
|
||||
var para:Object = {};
|
||||
var noability:Boolean = true;
|
||||
for each(var key:String in EquipVo.EQUIP_PARAS)
|
||||
{
|
||||
if(ability[key] != null)
|
||||
{
|
||||
noability = false;
|
||||
para[key] = {"val":ability[key]};
|
||||
}
|
||||
else
|
||||
{
|
||||
para[key] = {"val":0};
|
||||
}
|
||||
}
|
||||
if(noability)
|
||||
{
|
||||
return lang("无");
|
||||
}
|
||||
return EquipVo.getAbilityEffectDes(para).join("<br/>");
|
||||
}
|
||||
|
||||
public function get from() : String
|
||||
{
|
||||
if(typeId <= 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return table().from;
|
||||
}
|
||||
|
||||
public function get author() : String
|
||||
{
|
||||
if(typeId <= 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return table().author;
|
||||
}
|
||||
|
||||
public function get cardImg() : String
|
||||
{
|
||||
if(typeId <= 0)
|
||||
{
|
||||
return "data/img/monster/skincard/skincard_0.png";
|
||||
}
|
||||
return "data/img/monster/skincard/skincard_" + showType + ".png";
|
||||
}
|
||||
|
||||
public function get cgImg() : String
|
||||
{
|
||||
return "data/img/monster/l/" + showType + "_l_0.png";
|
||||
}
|
||||
|
||||
public function get cgImgFix() : Object
|
||||
{
|
||||
return Table.monster_info[showType].imgFix["l"];
|
||||
}
|
||||
|
||||
public function table() : Object
|
||||
{
|
||||
if(typeId <= 0)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
if(Table.skin_info == null || Table.skin_info[typeId.toString()] == null)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
return Table.skin_info[typeId.toString()];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package net.pixvi.myr.element.msg
|
||||
{
|
||||
import net.pixvi.common.utils.PiObject;
|
||||
|
||||
public class MailBoxVo extends PiObject
|
||||
{
|
||||
|
||||
public var mails:Array;
|
||||
|
||||
public function MailBoxVo()
|
||||
{
|
||||
super();
|
||||
mails = [];
|
||||
}
|
||||
|
||||
public function getMailById(id:int) : MailVo
|
||||
{
|
||||
for each(var mailvo:MailVo in mails)
|
||||
{
|
||||
if(mailvo.id == id)
|
||||
{
|
||||
return mailvo;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package net.pixvi.myr.element.msg
|
||||
{
|
||||
import net.pixvi.common.utils.PiObject;
|
||||
import net.pixvi.myr.center.TimeCenter;
|
||||
import net.pixvi.myr.element.reward.RewardVo;
|
||||
import net.pixvi.myr.util.MyrCalendar;
|
||||
|
||||
public class MailVo extends PiObject
|
||||
{
|
||||
|
||||
public var id:int;
|
||||
|
||||
public var title:String;
|
||||
|
||||
public var content:String;
|
||||
|
||||
public var date:Number;
|
||||
|
||||
public var read:Boolean;
|
||||
|
||||
public var level:int;
|
||||
|
||||
public var reward:Object = null;
|
||||
|
||||
public var getReward:Boolean = false;
|
||||
|
||||
public var isCollectionMail:Boolean = false;
|
||||
|
||||
public function MailVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function get rewardVo() : RewardVo
|
||||
{
|
||||
var rvo:RewardVo = new RewardVo();
|
||||
rvo.setByObjectAuto(reward);
|
||||
return rvo;
|
||||
}
|
||||
|
||||
public function get hasReward() : Boolean
|
||||
{
|
||||
if(reward == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(reward.money == 0 && reward.ke == 0 && reward.ti == 0 && reward.exp == 0 && (reward.rewards == null || reward.rewards.length == 0))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return reward != null;
|
||||
}
|
||||
|
||||
public function get overday() : int
|
||||
{
|
||||
return 7 - (MyrCalendar.getDayNumber(TimeCenter.timestamp * 1000) - MyrCalendar.getDayNumber(this.date * 1000));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,248 @@
|
||||
package net.pixvi.myr.element.npc
|
||||
{
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.StageCenter;
|
||||
import net.pixvi.myr.center.TaskCenter;
|
||||
import net.pixvi.myr.center.TimeCenter;
|
||||
import net.pixvi.myr.element.task.TaskVo;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.utils.Calendar;
|
||||
|
||||
public class ConditionVo
|
||||
{
|
||||
|
||||
public var finishTask:Array;
|
||||
|
||||
public var unfinishTask:Array;
|
||||
|
||||
public var passStage:Array;
|
||||
|
||||
public var unlockStage:Array;
|
||||
|
||||
public var startTime:int;
|
||||
|
||||
public var endTime:int;
|
||||
|
||||
public var week:Array = [0,1,2,3,4,5,6];
|
||||
|
||||
public var startTimestamp:uint = 0;
|
||||
|
||||
public var endTimestamp:uint = 0;
|
||||
|
||||
public var minLevel:int;
|
||||
|
||||
public var maxLevel:int;
|
||||
|
||||
public var close:Boolean = false;
|
||||
|
||||
public var platform:String = "all";
|
||||
|
||||
public var channel:String = "all";
|
||||
|
||||
public var lang:String = "all";
|
||||
|
||||
public function ConditionVo(data:Object = null)
|
||||
{
|
||||
super();
|
||||
normal();
|
||||
if(data != null)
|
||||
{
|
||||
ondata(data);
|
||||
}
|
||||
}
|
||||
|
||||
public static function checkCondition(conObj:Object) : Boolean
|
||||
{
|
||||
var coon:ConditionVo = new ConditionVo(conObj);
|
||||
return coon.check();
|
||||
}
|
||||
|
||||
public function ondata(data:Object) : void
|
||||
{
|
||||
if(data == null)
|
||||
{
|
||||
normal();
|
||||
return;
|
||||
}
|
||||
if(data.platform != null)
|
||||
{
|
||||
platform = data.platform;
|
||||
}
|
||||
if(data.channel != null)
|
||||
{
|
||||
channel = data.channel;
|
||||
}
|
||||
finishTask = data.finishTask;
|
||||
unfinishTask = data.unfinishTask;
|
||||
startTime = data.startTime;
|
||||
if(data.endTime == null)
|
||||
{
|
||||
endTime = 2147483647;
|
||||
}
|
||||
else
|
||||
{
|
||||
endTime = data.endTime;
|
||||
}
|
||||
if(data.close != null)
|
||||
{
|
||||
this.close = data.close;
|
||||
}
|
||||
if(data.week != null)
|
||||
{
|
||||
week = data.week;
|
||||
}
|
||||
if(data.minLevel != null)
|
||||
{
|
||||
minLevel = data.minLevel;
|
||||
}
|
||||
else
|
||||
{
|
||||
minLevel = 0;
|
||||
}
|
||||
if(data.passStage == null)
|
||||
{
|
||||
passStage = data.passStage;
|
||||
}
|
||||
else
|
||||
{
|
||||
passStage = [];
|
||||
}
|
||||
if(data.unlockStage == null)
|
||||
{
|
||||
unlockStage = [];
|
||||
}
|
||||
else
|
||||
{
|
||||
unlockStage = data.unlockStage;
|
||||
}
|
||||
if(data.maxLevel == null)
|
||||
{
|
||||
maxLevel = 2147483647;
|
||||
}
|
||||
else
|
||||
{
|
||||
maxLevel = data.maxLevel;
|
||||
}
|
||||
if(data.startTimestamp != null)
|
||||
{
|
||||
startTimestamp = data.startTimestamp;
|
||||
}
|
||||
if(data.endTimestamp != null)
|
||||
{
|
||||
endTimestamp = data.endTimestamp;
|
||||
}
|
||||
else
|
||||
{
|
||||
endTimestamp = 2147483647;
|
||||
}
|
||||
}
|
||||
|
||||
public function normal() : void
|
||||
{
|
||||
finishTask = [];
|
||||
unfinishTask = [];
|
||||
passStage = [];
|
||||
unlockStage = [];
|
||||
startTime = 0;
|
||||
endTime = 2400;
|
||||
week = [0,1,2,3,4,5,6];
|
||||
minLevel = 0;
|
||||
maxLevel = 99999;
|
||||
startTimestamp = 0;
|
||||
endTimestamp = 2147483647;
|
||||
}
|
||||
|
||||
public function check() : Boolean
|
||||
{
|
||||
var taskTypeId:String = null;
|
||||
var i:int = 0;
|
||||
var j:int = 0;
|
||||
var taskvo:TaskVo = null;
|
||||
var k:int = 0;
|
||||
var k2:int = 0;
|
||||
var level:int = int(Master.level);
|
||||
if(minLevel > level || maxLevel < level || close)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(platform != null && platform != "all" && platform != MyrCenter.platform)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(channel != null && channel != "all" && channel != MyrCenter.channel)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(lang != null && lang != "all" && lang != MyrCenter.lang)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(finishTask != null)
|
||||
{
|
||||
for(i = 0; i < finishTask.length; )
|
||||
{
|
||||
taskTypeId = finishTask[i];
|
||||
if(Master.history.passTask[taskTypeId] != true)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if(unfinishTask != null)
|
||||
{
|
||||
for(j = 0; j < unfinishTask.length; )
|
||||
{
|
||||
taskTypeId = unfinishTask[j];
|
||||
taskvo = TaskCenter.getIns().getTaskByType(taskTypeId);
|
||||
if(Master.history.passTask[taskTypeId] == true || taskvo != null && taskvo.recieved)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
if(passStage != null && passStage.length > 0)
|
||||
{
|
||||
for(k = 0; k < passStage.length; )
|
||||
{
|
||||
if(!StageCenter.getIns().isStagePass(passStage[k]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
k++;
|
||||
}
|
||||
}
|
||||
if(unlockStage != null && unlockStage.length > 0)
|
||||
{
|
||||
for(k2 = 0; k2 < unlockStage.length; )
|
||||
{
|
||||
if(!StageCenter.getIns().isStageUnlock(unlockStage[k2]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
k2++;
|
||||
}
|
||||
}
|
||||
var curshowdata:Date = Calendar.getShowDate();
|
||||
if(week != null)
|
||||
{
|
||||
if(week.indexOf(curshowdata.day) == -1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
var curTime:int = curshowdata.hours * 100 + curshowdata.minutes;
|
||||
if(curTime < startTime || curTime > endTime)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(TimeCenter.timestamp < startTimestamp || TimeCenter.timestamp > endTimestamp)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
package net.pixvi.myr.element.npc
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.center.MonsterCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
|
||||
public class NPCVo
|
||||
{
|
||||
|
||||
public var type:String;
|
||||
|
||||
public function NPCVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function get darkMode() : Boolean
|
||||
{
|
||||
if(getTable() != null && getTable().darkMode == true)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function get name() : String
|
||||
{
|
||||
var montype:String = null;
|
||||
var mon:MonsterVo = null;
|
||||
if(type.indexOf("jb_") == 0)
|
||||
{
|
||||
montype = type.substr(3);
|
||||
mon = MonsterCenter.getIns().getEntangleMonByType(int(montype));
|
||||
return mon.name;
|
||||
}
|
||||
return getTable().name;
|
||||
}
|
||||
|
||||
public function get des() : String
|
||||
{
|
||||
if(type.indexOf("jb_") == 0)
|
||||
{
|
||||
return lang("羁绊魔物");
|
||||
}
|
||||
return getTable().des;
|
||||
}
|
||||
|
||||
public function getTable() : Object
|
||||
{
|
||||
return Table.npc_info[type];
|
||||
}
|
||||
|
||||
public function exsist() : Boolean
|
||||
{
|
||||
if(type.indexOf("jb_") == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return Table.npc_info[type] != null;
|
||||
}
|
||||
|
||||
public function img_avatar() : String
|
||||
{
|
||||
var montype:String = null;
|
||||
montype = null;
|
||||
if(type.indexOf("jb_") == 0)
|
||||
{
|
||||
montype = type.substr(3);
|
||||
return "data/img/monster/ta/" + montype + "_ta_0.png";
|
||||
}
|
||||
if(getTable().avatar.indexOf("mon_") == 0)
|
||||
{
|
||||
montype = getTable().avatar.substr(4);
|
||||
return "data/img/monster/ta/" + montype + "_ta_0.png";
|
||||
}
|
||||
return "data/img/avatar/" + getTable().avatar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package net.pixvi.myr.element.npc
|
||||
{
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class PositionNPC
|
||||
{
|
||||
|
||||
public var npc:String;
|
||||
|
||||
public var position:String;
|
||||
|
||||
public var random:Number;
|
||||
|
||||
public var storys:Array;
|
||||
|
||||
public var condition:ConditionVo;
|
||||
|
||||
public function PositionNPC()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function ondata(data:Object) : void
|
||||
{
|
||||
npc = data.npc;
|
||||
position = data.position;
|
||||
random = data.random;
|
||||
storys = data.storys;
|
||||
condition = new ConditionVo();
|
||||
condition.ondata(data.condition);
|
||||
}
|
||||
|
||||
public function getStory() : String
|
||||
{
|
||||
return Random.element(storys) as String;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package net.pixvi.myr.element.randomevent
|
||||
{
|
||||
public class RandomEventType
|
||||
{
|
||||
|
||||
public static var FARM_EVENT:int = 1;
|
||||
|
||||
public static var FARM_TIMER_NAME:String = "farmEventTimer";
|
||||
|
||||
public static var MON_EVENT:int = 2;
|
||||
|
||||
public static var MON_TIMER_NAME:String = "monEventTimer";
|
||||
|
||||
public static var STAGE_EVENT:int = 3;
|
||||
|
||||
public static var STAGE_TIMER_NAME:String = "stageEventTimer";
|
||||
|
||||
public static var eventTimerNames:Array = ["farmEventTimer","monEventTimer","stageEventTimer"];
|
||||
|
||||
public static var TypeName:Object = {
|
||||
"1":"牧场事件",
|
||||
"2":"魔物事件",
|
||||
"3":"关卡事件"
|
||||
};
|
||||
|
||||
public function RandomEventType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
package net.pixvi.myr.element.randomevent
|
||||
{
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.center.TimeCenter;
|
||||
|
||||
public class RandomEventVo
|
||||
{
|
||||
|
||||
public var typeId:String;
|
||||
|
||||
public function RandomEventVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function get des() : String
|
||||
{
|
||||
return table.des;
|
||||
}
|
||||
|
||||
public function get img() : String
|
||||
{
|
||||
return ImgCenter.farmEventImg(table.img);
|
||||
}
|
||||
|
||||
public function get eventType() : String
|
||||
{
|
||||
return table.eventType;
|
||||
}
|
||||
|
||||
public function get chance() : int
|
||||
{
|
||||
return table.chance;
|
||||
}
|
||||
|
||||
public function get table() : Object
|
||||
{
|
||||
return Table.event_table[typeId];
|
||||
}
|
||||
|
||||
public function get miniGame() : int
|
||||
{
|
||||
return table.miniGame;
|
||||
}
|
||||
|
||||
public function get storyPosition() : String
|
||||
{
|
||||
return table.storyPosition;
|
||||
}
|
||||
|
||||
public function get storyNpc() : String
|
||||
{
|
||||
if(table.storyNpc == null || table.storyNpc == "")
|
||||
{
|
||||
return "event";
|
||||
}
|
||||
return table.storyNpc;
|
||||
}
|
||||
|
||||
public function get story() : String
|
||||
{
|
||||
return table.story;
|
||||
}
|
||||
|
||||
public function get hasPositionStory() : Boolean
|
||||
{
|
||||
return hasStory && storyNpc != null && storyNpc != "";
|
||||
}
|
||||
|
||||
public function get hasStory() : Boolean
|
||||
{
|
||||
return story != null && story != "";
|
||||
}
|
||||
|
||||
public function get hasImg() : Boolean
|
||||
{
|
||||
return img != null && img != "";
|
||||
}
|
||||
|
||||
public function hasTalk(pos:String) : Boolean
|
||||
{
|
||||
var i:int = 0;
|
||||
if(eventType == RandomEventType.FARM_EVENT.toString() && Master.randomEventTimer[RandomEventType.FARM_TIMER_NAME] < (TimeCenter.timestamp - 30) * 1000)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var posArr:Array = pos.split("_");
|
||||
var sposArr:Array = storyPosition.split("_");
|
||||
if(posArr.length != sposArr.length)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
i = 0;
|
||||
while(i < sposArr.length)
|
||||
{
|
||||
if(posArr[i] == null || posArr[i].indexOf(sposArr[i]) != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package net.pixvi.myr.element.rank
|
||||
{
|
||||
public class RankDataVo
|
||||
{
|
||||
|
||||
public var rank:Number;
|
||||
|
||||
public var point:Number;
|
||||
|
||||
public var roleName:String;
|
||||
|
||||
public var roleLevel:int;
|
||||
|
||||
public var roleAvatar:int;
|
||||
|
||||
public function RankDataVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function onData(data:Object) : void
|
||||
{
|
||||
var bignum:Number = Number(data.score);
|
||||
point = int(bignum / Math.pow(10,14));
|
||||
roleName = data.roleName;
|
||||
roleLevel = data.level;
|
||||
roleAvatar = data.avatar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package net.pixvi.myr.element.rank
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
|
||||
public class RankType
|
||||
{
|
||||
|
||||
public static const STAGE_STAR:String = "rank_stage_star";
|
||||
|
||||
public static const LEVEL:String = "rank_level";
|
||||
|
||||
public static const MON_LIB:String = "rank_mon_lib";
|
||||
|
||||
public static const PVE_LAH:String = "rank_pve_lah";
|
||||
|
||||
public static const PVE_BSLM:String = "rank_pve_bslm";
|
||||
|
||||
public static const PVE_NSLM:String = "rank_pve_nslm";
|
||||
|
||||
public static const PVE_LRJ:String = "rank_pve_lrj";
|
||||
|
||||
public static var _rankName:Object;
|
||||
|
||||
public function RankType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function get rankName() : Object
|
||||
{
|
||||
if(_rankName == null)
|
||||
{
|
||||
_rankName = {
|
||||
"rank_stage_star":lang("探索"),
|
||||
"rank_level":lang("等级"),
|
||||
"rank_mon_lib":lang("图鉴"),
|
||||
"rank_pve_lah":lang("积分"),
|
||||
"rank_pve_bslm":lang("积分"),
|
||||
"rank_pve_nslm":lang("积分"),
|
||||
"rank_pve_lrj":lang("积分")
|
||||
};
|
||||
}
|
||||
return _rankName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package net.pixvi.myr.element.rank
|
||||
{
|
||||
public class RankVo
|
||||
{
|
||||
|
||||
public var myData:RankDataVo;
|
||||
|
||||
public var datas:Array;
|
||||
|
||||
public var rankType:String;
|
||||
|
||||
public var rankTime:int;
|
||||
|
||||
public function RankVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function onData(re:Object) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var ndata:RankDataVo = null;
|
||||
myData = new RankDataVo();
|
||||
myData.onData(re.myRankData);
|
||||
myData.rank = re.myIndex;
|
||||
datas = [];
|
||||
for(i = 0; i < re.rankDatas.length; )
|
||||
{
|
||||
ndata = new RankDataVo();
|
||||
ndata.onData(re.rankDatas[i]);
|
||||
ndata.rank = i + 1;
|
||||
datas.push(ndata);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,206 @@
|
||||
package net.pixvi.myr.element.reward
|
||||
{
|
||||
import net.pixvi.myr.element.bag.EquipVo;
|
||||
import net.pixvi.myr.element.bag.ItemType;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.mon.EggVo;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.pfw.utils.Mapper;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class RewardPieceVo
|
||||
{
|
||||
|
||||
public var num:int = 0;
|
||||
|
||||
public var monsters:Array;
|
||||
|
||||
public var monMode:int = 0;
|
||||
|
||||
public var chance:Number = 1;
|
||||
|
||||
public var item_num:int = 0;
|
||||
|
||||
public var items:Array;
|
||||
|
||||
public var item_chance:Number = 1;
|
||||
|
||||
public function RewardPieceVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function getAllRewardList() : Array
|
||||
{
|
||||
var egg:EggVo = null;
|
||||
var mon:MonsterVo = null;
|
||||
var pa:Array = null;
|
||||
var item:ItemVo = null;
|
||||
var rewards:Array = [];
|
||||
if(monsters != null && num > 0)
|
||||
{
|
||||
for each(var o:Object in monsters)
|
||||
{
|
||||
if(monMode == 0)
|
||||
{
|
||||
egg = new EggVo();
|
||||
egg.type = o.name;
|
||||
rewards.push(egg);
|
||||
}
|
||||
else
|
||||
{
|
||||
mon = new MonsterVo(o.name);
|
||||
mon.buildRandom();
|
||||
mon.setLocalMode(monMode);
|
||||
if(monMode == 0)
|
||||
{
|
||||
mon.process = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
mon.process = 3;
|
||||
}
|
||||
rewards.push(mon);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(items != null && items.length > 0)
|
||||
{
|
||||
for each(var itemvo:Object in items)
|
||||
{
|
||||
pa = itemvo.name.split(",");
|
||||
item = new ItemVo();
|
||||
item.type = pa[0];
|
||||
item.num = 1;
|
||||
rewards.push(item);
|
||||
}
|
||||
}
|
||||
return rewards;
|
||||
}
|
||||
|
||||
public function makeRewards() : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var montype:int = 0;
|
||||
var egg:EggVo = null;
|
||||
var mon:MonsterVo = null;
|
||||
i = 0;
|
||||
var pa:Array = null;
|
||||
var itemnum:int = 0;
|
||||
var maxNum:int = 0;
|
||||
var item:ItemVo = null;
|
||||
var j:int = 0;
|
||||
item = null;
|
||||
var rewards:Array = [];
|
||||
var itemTypeDic:Object = {};
|
||||
if(monsters != null && monsters.length > 0)
|
||||
{
|
||||
for(i = 0; i < num; )
|
||||
{
|
||||
if(chance > Math.random())
|
||||
{
|
||||
montype = int(Random.elementWithChance(monsters).name);
|
||||
if(monMode == 0)
|
||||
{
|
||||
egg = new EggVo();
|
||||
egg.type = montype;
|
||||
egg.num = 1;
|
||||
rewards.push(egg);
|
||||
}
|
||||
else
|
||||
{
|
||||
mon = new MonsterVo(montype);
|
||||
mon.buildRandom();
|
||||
mon.setLocalMode(monMode);
|
||||
if(monMode == 0)
|
||||
{
|
||||
mon.process = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
mon.process = 3;
|
||||
}
|
||||
rewards.push(mon);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if(items != null && items.length > 0)
|
||||
{
|
||||
for(i = 0; i < item_num; )
|
||||
{
|
||||
if(item_chance >= Math.random())
|
||||
{
|
||||
pa = Random.elementWithChance(items).name.split(",");
|
||||
if(pa[1] == null)
|
||||
{
|
||||
pa[1] = 1;
|
||||
}
|
||||
if(pa[2] == null)
|
||||
{
|
||||
pa[2] = 1;
|
||||
}
|
||||
itemnum = Random.integer(pa[1],pa[2]);
|
||||
maxNum = ItemVo.getMaxNum(pa[0]);
|
||||
while(itemnum > 0)
|
||||
{
|
||||
item = new ItemVo();
|
||||
item.type = pa[0];
|
||||
if(item.itemType == ItemType.TYPE_EQUIP)
|
||||
{
|
||||
item = new EquipVo();
|
||||
item.type = pa[0];
|
||||
(item as EquipVo).buildAuto();
|
||||
}
|
||||
if(itemnum > maxNum)
|
||||
{
|
||||
item.num = maxNum;
|
||||
itemnum -= maxNum;
|
||||
}
|
||||
else
|
||||
{
|
||||
item.num = itemnum;
|
||||
itemnum = 0;
|
||||
}
|
||||
rewards.push(item);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
for(j = 0; j < rewards.length; )
|
||||
{
|
||||
if(rewards[j] is ItemVo)
|
||||
{
|
||||
item = rewards[j];
|
||||
if(!(item is EquipVo))
|
||||
{
|
||||
if(itemTypeDic[item.type] != null)
|
||||
{
|
||||
itemTypeDic[item.type].num += item.num;
|
||||
rewards.splice(j,1);
|
||||
j--;
|
||||
}
|
||||
else
|
||||
{
|
||||
itemTypeDic[item.type] = item;
|
||||
}
|
||||
}
|
||||
}
|
||||
j++;
|
||||
}
|
||||
return rewards;
|
||||
}
|
||||
|
||||
public function readObject(obj:Object) : void
|
||||
{
|
||||
if(obj.hasOwnProperty("type"))
|
||||
{
|
||||
delete obj.type;
|
||||
}
|
||||
Mapper.fillVariables(this,obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
package net.pixvi.myr.element.reward
|
||||
{
|
||||
import net.pixvi.myr.center.BagCenter;
|
||||
import net.pixvi.myr.center.MonsterCenter;
|
||||
import net.pixvi.myr.element.bag.ItemType;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
|
||||
public class RewardResultVo
|
||||
{
|
||||
|
||||
public var money:int = 0;
|
||||
|
||||
public var ke:int = 0;
|
||||
|
||||
public var ti:int = 0;
|
||||
|
||||
public var exp:int = 0;
|
||||
|
||||
public var items:Array = [];
|
||||
|
||||
public var monsters:Array = [];
|
||||
|
||||
public function RewardResultVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function getMonsters() : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var getmons:Array = [];
|
||||
if(monsters != null)
|
||||
{
|
||||
for(i = 0; i < monsters.length; )
|
||||
{
|
||||
getmons.push(MonsterCenter.getMonByMonData(monsters[i]));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
return getmons;
|
||||
}
|
||||
|
||||
public function getItems() : Array
|
||||
{
|
||||
var j:int = 0;
|
||||
var getitems:Array = [];
|
||||
if(items != null)
|
||||
{
|
||||
for(j = 0; j < items.length; )
|
||||
{
|
||||
getitems.push(BagCenter.getItemByItemData(items[j]));
|
||||
j++;
|
||||
}
|
||||
}
|
||||
return getitems;
|
||||
}
|
||||
|
||||
public function getRewardShowArray() : Array
|
||||
{
|
||||
var o:RewardShowVo = null;
|
||||
var i:int = 0;
|
||||
var itemvo:ItemVo = null;
|
||||
var arr:Array = [];
|
||||
if(ke > 0)
|
||||
{
|
||||
o = new RewardShowVo();
|
||||
o.number = ke;
|
||||
o.rewardType = RewardType.KE;
|
||||
arr.push(o);
|
||||
}
|
||||
if(ti > 0)
|
||||
{
|
||||
o = new RewardShowVo();
|
||||
o.number = ti;
|
||||
o.rewardType = RewardType.TI;
|
||||
arr.push(o);
|
||||
}
|
||||
if(money > 0)
|
||||
{
|
||||
o = new RewardShowVo();
|
||||
o.number = money;
|
||||
o.rewardType = RewardType.MONEY;
|
||||
arr.push(o);
|
||||
}
|
||||
if(exp > 0)
|
||||
{
|
||||
o = new RewardShowVo();
|
||||
o.number = exp;
|
||||
o.rewardType = RewardType.EXP;
|
||||
arr.push(o);
|
||||
}
|
||||
arr = arr.concat(getMonsters());
|
||||
arr = arr.concat(getItems());
|
||||
var itemdic:Object = {};
|
||||
for(i = 0; i < arr.length; )
|
||||
{
|
||||
if(arr[i] is ItemVo)
|
||||
{
|
||||
itemvo = arr[i];
|
||||
if(itemvo.itemType != ItemType.TYPE_EGG && itemvo.itemType != ItemType.TYPE_EQUIP)
|
||||
{
|
||||
if(itemdic[itemvo.type] != null)
|
||||
{
|
||||
itemdic[itemvo.type].num += itemvo.num;
|
||||
arr.splice(i,1);
|
||||
i--;
|
||||
}
|
||||
else
|
||||
{
|
||||
itemdic[itemvo.type] = itemvo;
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package net.pixvi.myr.element.reward
|
||||
{
|
||||
public class RewardShowVo
|
||||
{
|
||||
|
||||
public var rewardType:String;
|
||||
|
||||
public var number:int = 0;
|
||||
|
||||
public function RewardShowVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function get name() : String
|
||||
{
|
||||
return RewardType.nameDic[rewardType];
|
||||
}
|
||||
|
||||
public function get imgsrc() : String
|
||||
{
|
||||
switch(rewardType)
|
||||
{
|
||||
case RewardType.MONEY:
|
||||
return "data/img/item/item_money.png";
|
||||
case RewardType.KE:
|
||||
return "data/img/item/item_ke.png";
|
||||
case RewardType.EXP:
|
||||
return "data/img/item/item_exp.png";
|
||||
case RewardType.TI:
|
||||
return "data/img/item/item_ti.png";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public function get quality() : int
|
||||
{
|
||||
return RewardType.qualityDic[rewardType];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package net.pixvi.myr.element.reward
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
|
||||
public class RewardType
|
||||
{
|
||||
|
||||
public static var MONEY:String = "money";
|
||||
|
||||
public static const MONSTER:String = "monster";
|
||||
|
||||
public static const ITEM:String = "item";
|
||||
|
||||
public static var KE:String = "ke";
|
||||
|
||||
public static var TI:String = "ti";
|
||||
|
||||
public static var EXP:String = "exp";
|
||||
|
||||
private static var _nameDic:Object;
|
||||
|
||||
public static var qualityDic:Object = {
|
||||
"money":5,
|
||||
"ke":5,
|
||||
"ti":5,
|
||||
"exp":5
|
||||
};
|
||||
|
||||
public function RewardType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function get nameDic() : Object
|
||||
{
|
||||
if(_nameDic == null)
|
||||
{
|
||||
_nameDic = {
|
||||
"money":lang("金币"),
|
||||
"monster":lang("魔物"),
|
||||
"item":lang("道具"),
|
||||
"ke":lang("氪金"),
|
||||
"ti":lang("体力"),
|
||||
"exp":lang("角色经验")
|
||||
};
|
||||
}
|
||||
return _nameDic;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,261 @@
|
||||
package net.pixvi.myr.element.reward
|
||||
{
|
||||
import net.pixvi.myr.CP;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.mon.EggVo;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.pfw.utils.ArrayUtil;
|
||||
import net.pixvi.pfw.utils.Mapper;
|
||||
|
||||
public class RewardVo
|
||||
{
|
||||
|
||||
public var rewards:Array = [];
|
||||
|
||||
public var money:int = 0;
|
||||
|
||||
public var ke:int = 0;
|
||||
|
||||
public var ti:int = 0;
|
||||
|
||||
public var exp:int = 0;
|
||||
|
||||
public var resultRewards:Array;
|
||||
|
||||
public var builded:Boolean = false;
|
||||
|
||||
public function RewardVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function buildRewards() : Array
|
||||
{
|
||||
var rp:RewardPieceVo = null;
|
||||
builded = true;
|
||||
resultRewards = [];
|
||||
for each(var o:Object in rewards)
|
||||
{
|
||||
rp = new RewardPieceVo();
|
||||
rp.readObject(o);
|
||||
resultRewards = resultRewards.concat(rp.makeRewards());
|
||||
}
|
||||
return resultRewards;
|
||||
}
|
||||
|
||||
public function getRewardShowArray() : Array
|
||||
{
|
||||
var o:RewardShowVo = null;
|
||||
if(!builded)
|
||||
{
|
||||
buildRewards();
|
||||
}
|
||||
var arr:Array = [];
|
||||
if(ke > 0)
|
||||
{
|
||||
o = new RewardShowVo();
|
||||
o.number = ke;
|
||||
o.rewardType = RewardType.KE;
|
||||
arr.push(o);
|
||||
}
|
||||
if(ti > 0)
|
||||
{
|
||||
o = new RewardShowVo();
|
||||
o.number = ti;
|
||||
o.rewardType = RewardType.TI;
|
||||
arr.push(o);
|
||||
}
|
||||
if(money > 0)
|
||||
{
|
||||
o = new RewardShowVo();
|
||||
o.number = money;
|
||||
o.rewardType = RewardType.MONEY;
|
||||
arr.push(o);
|
||||
}
|
||||
if(exp > 0)
|
||||
{
|
||||
o = new RewardShowVo();
|
||||
o.number = exp;
|
||||
o.rewardType = RewardType.EXP;
|
||||
arr.push(o);
|
||||
}
|
||||
return arr.concat(resultRewards);
|
||||
}
|
||||
|
||||
public function setByObject(obj:Object) : void
|
||||
{
|
||||
Mapper.fillVariables(this,obj);
|
||||
}
|
||||
|
||||
public function setByObjectAuto(obj:Object) : void
|
||||
{
|
||||
if(obj != null)
|
||||
{
|
||||
if(obj.rewards != null)
|
||||
{
|
||||
setByObject(obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
setByRewardMiniVo(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function toDesString(space:String = " ") : String
|
||||
{
|
||||
var ss:String = null;
|
||||
var s:String = "";
|
||||
var arr:Array = getRewardShowArray();
|
||||
for each(var o:Object in arr)
|
||||
{
|
||||
ss = "";
|
||||
if(o is MonsterVo)
|
||||
{
|
||||
ss = (o as MonsterVo).desName;
|
||||
ss = CP.mon(ss);
|
||||
}
|
||||
else if(o is EggVo)
|
||||
{
|
||||
ss = (o as EggVo).desName + "x" + (o as ItemVo).num;
|
||||
ss = CP.item(ss);
|
||||
}
|
||||
else if(o is ItemVo)
|
||||
{
|
||||
ss = (o as ItemVo).name + "x" + (o as ItemVo).num;
|
||||
ss = CP.item(ss);
|
||||
}
|
||||
else if(o is RewardShowVo)
|
||||
{
|
||||
ss = (o as RewardShowVo).name + "x" + (o as RewardShowVo).number;
|
||||
switch((o as RewardShowVo).rewardType)
|
||||
{
|
||||
case RewardType.KE:
|
||||
ss = CP.ke(ss);
|
||||
break;
|
||||
case RewardType.MONEY:
|
||||
ss = CP.money(ss);
|
||||
break;
|
||||
case RewardType.EXP:
|
||||
ss = CP.exp(ss);
|
||||
break;
|
||||
case RewardType.TI:
|
||||
ss = CP.ti(ss);
|
||||
}
|
||||
}
|
||||
s += ss + space;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
public function setByRewardMiniVo(minivo:Object) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var rp:Object = null;
|
||||
var j:int = 0;
|
||||
var rp2:Object = null;
|
||||
if(minivo.money == null)
|
||||
{
|
||||
minivo.money = 0;
|
||||
}
|
||||
if(minivo.ke == null)
|
||||
{
|
||||
minivo.ke = 0;
|
||||
}
|
||||
if(minivo.ti == null)
|
||||
{
|
||||
minivo.ti = 0;
|
||||
}
|
||||
if(minivo.exp == null)
|
||||
{
|
||||
minivo.exp = 0;
|
||||
}
|
||||
money = minivo.money;
|
||||
ke = minivo.ke;
|
||||
ti = minivo.ti;
|
||||
exp = minivo.exp;
|
||||
if(minivo.mons != null)
|
||||
{
|
||||
for(i = 0; i < minivo.mons.length; )
|
||||
{
|
||||
if(Table.monster_info[minivo.mons[i].type] != null)
|
||||
{
|
||||
rp = {};
|
||||
rp.num = minivo.mons[i].num;
|
||||
rp.monMode = minivo.mons[i].mode;
|
||||
rp.monsters = [{
|
||||
"name":minivo.mons[i].type,
|
||||
"value":1
|
||||
}];
|
||||
rp.chance = 1;
|
||||
rewards.push(rp);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if(minivo.items != null)
|
||||
{
|
||||
for(j = 0; j < minivo.items.length; )
|
||||
{
|
||||
if(Table.item_info[minivo.items[j].type] != null)
|
||||
{
|
||||
rp2 = {};
|
||||
rp2.item_num = minivo.items[j].num;
|
||||
rp2.item_chance = 1;
|
||||
rp2.items = [{
|
||||
"name":minivo.items[j].type + ",1,1",
|
||||
"value":1
|
||||
}];
|
||||
rewards.push(rp2);
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getAllRewardList() : Array
|
||||
{
|
||||
var rp:RewardPieceVo = null;
|
||||
var i:int = 0;
|
||||
var allRewards:Array = [];
|
||||
for each(var o:Object in rewards)
|
||||
{
|
||||
rp = new RewardPieceVo();
|
||||
rp.readObject(o);
|
||||
allRewards = allRewards.concat(rp.getAllRewardList());
|
||||
}
|
||||
ArrayUtil.sortByClass(allRewards,[MonsterVo,EggVo,ItemVo],["star","star","quality"],2 | 0x10);
|
||||
var montype:Array = [];
|
||||
var itemtype:Array = [];
|
||||
for(i = 0; i < allRewards.length; )
|
||||
{
|
||||
if(allRewards[i] is MonsterVo || allRewards[i] is EggVo)
|
||||
{
|
||||
if(montype.indexOf(allRewards[i].type) == -1)
|
||||
{
|
||||
montype.push(allRewards[i].type);
|
||||
}
|
||||
else
|
||||
{
|
||||
allRewards.splice(i,1);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
else if(itemtype.indexOf((allRewards[i] as ItemVo).type) == -1)
|
||||
{
|
||||
itemtype.push((allRewards[i] as ItemVo).type);
|
||||
}
|
||||
else
|
||||
{
|
||||
allRewards.splice(i,1);
|
||||
i--;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
allRewards.sortOn("quality",0x10 | 2);
|
||||
return allRewards;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package net.pixvi.myr.element.room
|
||||
{
|
||||
public class RoomOpenType
|
||||
{
|
||||
|
||||
public static const MONEY:int = 1;
|
||||
|
||||
public static const KE:int = 2;
|
||||
|
||||
public static const FREE:int = 3;
|
||||
|
||||
public function RoomOpenType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user