Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user