model研究(一)

AttackMode 攻击模式
TYPE_NORMAL  普通攻击
TYPE_TEAM       团队模式
TYPE_GANG      帮会模式
TYPE_ALL         全部模式
_name          名称
_shortName   短名称
_type    类型
getAttackMode 得到attackmode
getNextAttackMode 得到下一个模式
--------------------
BaseInfo  基础信息
protected info : Object;
..
setData(data : Object, fireEvent : Boolean = true)
{
dispatchEvent(new InfoEvent(InfoEvent.INFO_CHANGE));
}
setValue(key : String, value : *, fireEvent : Boolean = true)
getString(key : String, defaultValue : String = "")
getInt(key : String, defaultValue : int = -1)

---------------------------
基础物品信息
BaseItemInfo extends BaseInfo implements IItemInfo
public static const KEY_ID : String = "id";
public static const KEY_TYPE_CODE : String = "type_code";
public static const KEY_TYPE : String = "type";
public static const KEY_SP_TYPE : String = "sp_type";
public static const KEY_ON_SALE : String = "on_sale";
public static const KEY_NAME : String = "name";
public static const KEY_DESCRIPT : String = "descript";
public static const KEY_MONEY : String = "money";
public static const KEY_GOLD : String = "gold";
public static const KEY_REC_MONEY : String = "rec_money";
public static const KEY_OVERLAY : String = "overlay";
public static const KEY_EXPIRY_HOUR : String = "expiry_hour";
public static const KEY_IS_BIND : String = "is_bind";
public static const KEY_CAN_TRADE : String = "can_trade";
public static const KEY_CAN_STORE : String = "can_store";
public static const KEY_CAN_USE : String = "can_use";
public static const KEY_CAN_DESTROY : String = "can_destroy";
public static const KEY_LEVEL_LMT : String = "level_lmt";
public static const KEY_SOUND_ID : String = "sound_id";
public static const KEY_SCRIPT_ID : String = "script_id";
public static const KEY_ICON : String = "icon";
public static const KEY_VALUABLES : String = "is_valuables";
public static const KEY_CD_TIME : String = "cd";
public static const KEY_CD_TYPE : String = "fcd";
public static const KEY_HONOR : String = "honor_point";
public static const KEY_QUALITY : String = "quality";
public static const KEY_QUEST_ID : String = "quest_id";
//参考ItemInfoType。1 装备,2 药品,3 属性宝石,4 杂项, 5图样
public function get type() : int {
return getInt(KEY_TYPE, -1);
}

-----------------------
IItemInfo 物品信息接口
function setData(value : Object, fireEvent : Boolean = true) : void;

function get id() : int;

function get systemId() : int;

//1 装备,2 药品,3 杂项
function get type() : int;

//是否出售。0不出售,1 NPC出售,2 商城出售
function get onSale() : int;

//游戏币
function get money() : int;

//元宝
function get gold() : int;

//荣誉值
function get honor() : int;

//回收价格
function get recycleMoney() : int;

//叠加数量上限
function get overlay() : int;

//使用时间(小时),0为不限
function get expiryHour() : int;

//是否绑定
function get isBind() : Boolean;

//能否交易,0 否,1是
function get canTrade() : Boolean;

//能否放入仓库,0 否,1是
function get canStore() : Boolean;

//能否摧毁,0 否,1是
function get canDestroy() : Boolean;

//等级限制,0不限
function get levelLmt() : int;

//对应的声音id
function get soundId() : int;

//触发的脚本id
function get scriptId() : int;

//触发的任务id
function get questId() : int;

//是否使用触发任务
function get hasQuest() : Boolean;
------------------------------------------------------------
IItem  物品接口
function get iconPath() : String;
function setStatus(value : int, isDispatchEvent : Boolean = false) : void;
function setIndex(value : int, isDispatchEvent : Boolean = false) : void;
//名字
function get name() : String;
//描述
function get descript() : String;
function get canUse() : Boolean;
function get locked() : Boolean;
function set locked(value : Boolean) : void;
function destroy() : void;
function clone() : IItem;
------------------------------
BuffInfo   效果信息
(BuffConfig)
public function get descript() : String
createBuffInfoByServerData(body : Object)
-------------------------------
BuildingInfo 建筑信息
---------------------
BuildingInfoVO  建筑信息vo

//类型
private var _type : int;
//名字
private var _name : String;
//建筑位图
private var _iconClass : Class;
//建筑描述
private var _desc : String;
//建筑产品id列表
private var _productList : Array;
//建筑升级信息数组(元素为BuildingUpgradeVO)
private var _upgradeInfoArr : Array;
BuildingInfoVO(type : int = -1, name : String = "", iconClass : Class = null, desc : String = "", productList : Array = null, upgradeInfoArr : Array = null)

public function get productList() : Array {
return ItemProduceConfig.instance.getBuildingProduct(_type);
------------------------------------
BuildingUpgradeVO 建筑升级信息vo
//当前建筑等级
public var level : int;
//体力
public var health : int;
//金钱
public var money : int;
//时间(秒)
public var time : int;
--------------------------------------
ChatTextInfo   聊天文字
/**
* 分线
*/
public var line : int = -1;

//频道
public var channelCmd : uint;
public var channelName : String;
public var channelColor : int;

//聊天内容
public var word : String;
public var wordColor : int;
public function get isSystemMessage() : Boolean {
return channelCmd == 0x0607;
}

public static function getLineStr(line : int) : String
//发送者
public var senderName : String;
public var senderID : int;
public var senderColor : int;
//内容附加人物vip标识
public var vip : Number;

public var viewCloud : Boolean;
---------------------------------------------------------
CoolDown 冷却类
public var id : int; 
public var time : int;
private var commonCD : CoolDown;
private var _lastRunTime : int;
private var _objects : Vector.<ICoolDownObject>;
private var _coolDowns : Vector.<CoolDown>;
public function CoolDown(id : int, time : int, commonCD : CoolDown = null) {
public function addObject(object : ICoolDownObject, currTime : int = -1)
public function removeObject(object : ICoolDownObject) : Boolean
addCoolDown(cd : CoolDown)
removeCoolDown(cd : CoolDown)
run(currTime : int, elapsedTime : int = 0)
------------------------------------
EquipmentItemInfo   extends ItemInfo 装备物品信息
public static const KEY_SEX : String = "sex";
public static const KEY_FACTION : String = "faction";
public static const KEY_EFFECTS_A : String = "effects_a";
-------------------------------------------

public static const KEY_HOLD : String = "hold";
public static const KEY_HOLD_MAX : String = "hold_max";

public static const KEY_INLAY : String = "inlay";
public static const KEY_INLAY_TYPE : String = "inlay_type";
public static const KEY_CAN_SPOILAGE : String = "can_spoilage";

public static const KEY_ACTOR : String = "actor";
public static const KEY_GRADE : String = "grade";
public static const KEY_UPGRADE : String = "upgrade";
public static const KEY_MOUNT_V : String = "mount_v";

//需求
public static const KEY_ATK_REQ : String = "atk_req";
public static const KEY_AGI_REQ : String = "agi_req";
public static const KEY_STR_REQ : String = "str_req";
public static const KEY_CON_REQ : String = "con_req";
public static const KEY_MUS_REQ : String = "mus_req";

//基础属性
public static const KEY_ATK : String = "atk";
public static const KEY_DEF : String = "def";
public static const KEY_ATK_LEVEL : String = "atk_level";
public static const KEY_AGI_ADD : String = "agi_add";
public static const KEY_STR_ADD : String = "str_add";
public static const KEY_CON_ADD : String = "con_add";
public static const KEY_MUS_ADD : String = "mus_add";
public static const KEY_HP_ADD : String = "hp_add";
public static const KEY_MP_ADD : String = "mp_add";
public static const KEY_CRIT : String = "crit";
public static const KEY_HIT : String = "hit";
public static const KEY_MISS : String = "miss";
                public static const KEY_APP : String = "app";
public static const KEY_ACT : String = "act";
                public static const SUFF_MAX : String = "_max";
public static const PREF_APPRAISE : String = "app_";
public static const PREF_ACTIVE : String = "act_";
/**
* 镶嵌宝石
* 镶嵌的位置最多为4个
*/
public function get inlay() : Array
---------------------------
GameSetCookie
private static const REJECT_MESSAGE : String = "m";
private static const REJECT_TEAM : String = "t";
private static const REJECT_ADDFRIEND : String = "f";
private static const REJECT_GETINFO : String = "l";
private static const REJECT_PLAYER : String = "s";
private static const REJECT_TRADE : String = "b";
private static const REJECT_STRANGERMESSAGE : String = "str";
private static const REJECT_BMG : String = "bmg";
private static const REJECT_EFFECT : String = "eff";
private static const BMG_VOLUME : String = "bmgVol";
private static const EFFECT_VOLUME : String = "effVol";
public static const KEY_HOLD : String = "hold";
public static const KEY_HOLD_MAX : String = "hold_max";
----------------------------------
FBInfo 副本信息
public var id : int;
public var type : int;
public var name : String;
public var sceneIDs : Array;
public var minLevel : int;
public var maxLevel : int;
public var minPlayer : int;
public var maxPlayer : int;
public var drops : Vector.<Array>;
public var descript : String;
get firstScene()
------------------------------------------------
EquipmentPlatItemInfo 图样
EquipmentPlatItemInfo(object : Object = null, fireEvent : Boolean = true)
studyLevel()
systemEquipmentInfo()

-------------------------
GangJob
/*
0 = "帮主";
1 = "副帮主";
2 = "长老";
3 = "堂主";
4 = "香主";
5 = "帮众";
*/
public static const LEVEL0 : GangJob = new GangJob(0, "帮主");
public static const LEVEL1 : GangJob = new GangJob(1, "副帮主");
public static const LEVEL2 : GangJob = new GangJob(2, "长老");
public static const LEVEL3 : GangJob = new GangJob(3, "堂主");
public static const LEVEL4 : GangJob = new GangJob(4, "香主");
public static const LEVEL5 : GangJob = new GangJob(5, "帮众");
-------------------------
GemItemInfo 属性宝石
public static const KEY_GEM_TYPE : String = "gem_type";
public static const KEY_GEM_GRADE : String = "gem_grade";
public static const KEY_AGI_ADD : String = "agi_add";
public static const KEY_STR_ADD : String = "str_add";
public static const KEY_CON_ADD : String = "con_add";
public static const KEY_MUS_ADD : String = "mus_add";
------------------------
HangInfo   挂机设置
-----------------
ICoolDownObject   extends EventListener
function get coolDowning() : Boolean;
function get coolDownId() : int;
function get coolDownTime() : int;

function get startCDTime() : int;
function get totalCDTime() : int;
// function setCoolDowning(value : Boolean) : void;
// function runCoolDown(time : int, elapsedTime : int = 0) : void;
function setCoolDown(cd : CoolDown) : void;

----------------------------
IItem  物品接口
function get iconPath() : String;
function setStatus(value : int, isDispatchEvent : Boolean = false) : void;
function setIndex(value : int, isDispatchEvent : Boolean = false) : void;
//名字
function get name() : String;
//描述
function get descript() : String;
function get canUse() : Boolean;
function get locked() : Boolean;
function set locked(value : Boolean) : void;
function destroy() : void;
function clone() : IItem;
--------------------------
InlayGem 镶嵌的宝石
/**
* 起始位置是1
*/
public var index : int = -1;
public var type : int;
public var add : int;
public var spId : int;
getSmallIconPath()
public function get addName() : String {
switch (type) {
case 301:
return "攻击";
case 302:
return "防御";
case 303:
return "命中";
case 304:
return "躲闪";
case 305:
return "生命";
case 306:
return "内力";
}
return "";
}
-----------------------------------------
ItemInfo
public static const KEY_SP_ID : String = "sp_id";
public static const KEY_POSITION : String = "position";
public static const KEY_STATUS : String = "status";
public static const KEY_AMOUNT : String = "amount";
public static const KEY_IDX : String = "idx";
public static const KEY_DURATION : String = "duration";
public static const KEY_MAX_DURATION : String = "max_duration";
public static const KEY_BIND : String = "bind";
public static const KEY_USE_UNTIL : String = "use_until";

/**
* 商店
*/
public static const STATUS_STORE : int = -4;
/**
* 技能
*/
public static const STATUS_SKILL : int = -3;
/**
* 快捷栏
*/
public static const STATUS_SHORTCUT : int = -2;
/**
* 无
*/
public static const STATUS_NONE : int = -1;
/**
* 锁定状态
*/
public static const STATUS_LOCK : int = 0;
/**
* 装备栏
*/
public static const STATUS_ARMED : int = 1;
/**
* 背包
*/
public static const STATUS_BAG : int = 2;
/**
* 仓库
*/
public static const STATUS_STORAGE : int = 3;
/**
* 交易中途状态,只能跟2(背包中)互换z
*/
public static const STATUS_TRADE : int = 4;
/**
* 帮会
*/
public static const STATUS_GANG : int = 5;
/**
* 摊位
*/
public static const STATUS_STALL : int = 6;
/**
* 许愿背包
*/
public static const STATUS_WISHBAG : int = 7;


/**
* 同一类型物品共享一个系统物品信息
*/
protected var _systemInfo : SystemItemInfo;

-----------------------------------------
ItemInfoFactory 创建ItemInfo,根据类型不同,创建不同类型的物品
public static function createItemInfo(data : Object)
if (data["sp_id"] != null) {
var type : int = SystemItemInfoManager.instance.getSystemItemInfoType(data["sp_id"]);

if (type == ItemInfoType.TYPE_Equipment) {
return new EquipmentItemInfo(data);
} else if (type == ItemInfoType.TYPE_Physic) {
return new PhysicItemInfo(data);
} else if (type == ItemInfoType.TYPE_Gem) {
return new GemItemInfo(data);
} else if (type == ItemInfoType.TYPE_Plat) {
return new EquipmentPlatItemInfo(data);
} else {
return new ItemInfo(data);
}
--------------------------------
ItemInfoType 物品类型
/**
* 装备
*/
public static const TYPE_Equipment : int = 1;
/**
* 药品
*/
public static const TYPE_Physic : int = 2;
/**
* 属性宝石
*/
public static const TYPE_Gem : int = 3;
/**
* 其他
*/
public static const TYPE_Other : int = 4;
/**
* 图样
*/
public static const TYPE_Plat : int = 5;


public static const TYPE_CODE_PHYSIC_PLAYER : int = 201;

public static const TYPE_CODE_PHYSIC_PET : int = 202;

public static const TYPE_CODE_HORSE : int = 112;

// 经验
public static const SPECIAL_ID_EXP : int = 1;
// 银
public static const SPECIAL_ID_MONEY : int = 2;
// 元宝
public static const SPECIAL_ID_GOLD : int = 3;
-----------------------------
ItemInfoG 一组系统ID相同的Item组
-----------------------
ItemSceneIcon   物品场景图标
public static const SCENE_ICON_MONEY : int = 0;
public static const SCENE_ICON_OTHER : int = 100;
public static const SCENE_ICON_PHYSIC : int = 101;
public static const SCENE_ICON_GEM : int = 102; //属性宝石
getSceneIconPathById(systemId : int)
getSceneIconPath(item : SystemItemInfo)
-------------------
ItemSpec 物品种类
/**
* 玄青石
*/
public static const XUAN_QING_SHI : int = 40000003;
/**
* 天工符
*/
public static const TIAN_GONG_FU : int = 40000002;
/**
* 金霞石
*/
public static const JING_XIA_SHI : int = 40000004;
/**
* 补天石
*/
public static const BU_TIAN_SHI : int = 40000005;

/**
* 凤凰令 道具
*/
public static const REVIVE : int = 40000081;

/**
* 洗髓丹
*/
public static const XISUIDAN : int = 40000086;

/**
* 世界喇叭
*/
public static const WORLD_SPEAKER : int = 40000085;

/**
* 隐姓符
*/
public static const YIN_XING_FU : int = 40000089;

/**
* 歃血令
*/
public static const SHA_XUE_LING : int = 40000079;
/**
* 闭关令
*/
public static const BI_GUAN_LING : int = 40000092;

/**
* 双倍经验单
*/
public static const DOUBLE_EXP : int = 40000091;

/**
* 战将复活
*/
public static const PET_REVIVE : int = 40000082;

/**
* 藏宝图全卷
*/
public static const TREASURE_MAP_FULL : int = 40000097;

/**
* 藏宝图钥匙
*/
public static const TREASURE_MAP_KEY : int = 40000098;

---------------------
LifeSkillProductConditionVO  生活技能生产条件vo
//所需的物品id
public var sp_id : int = -1;
//所需的物品名称
public var name : String = "";
//所需的物品数量
public var num : int = 0;
---------------------------
LifeSkillSubVO  生活技能子分类vo
public var sub : int = -1;
public var name : String = "";
-------------------------------
LifeSkillProductVO  生活技能生产的产品vo
//产品id
public var sp_id:int = -1;
//产品名称
public var name:String = "";
//产品描述
public var desc:String = "";
//图标地址
public var iconPath:String = "";
//生产该产品所需的物品列表
public var needList:Vector.<LifeSkillProductConditionVO> = null;
//所需体力
public var needStra:int = -1;
//所需等级
public var needLevel:int = -1;
//所属的分类
public var type:int = -1;
public var sub:int = -1;
//产品的品质0-3(白-紫)
public var quality:int = -1;
--------------------------------
LifeSkillTypeVO 生活技能分类vo
//类型
public var type : int = -1;
//名称
public var name : String = "";
//图标地址
public var iconPath : String = "";
//经验值
public var exp : int = -1;
//等级
public var level : int = -1;
//子分类
public var subList : Vector.<LifeSkillSubVO> = null;
-----------------------------
NPCDialogInfo NPC对话内容
/**
* npc id
*/
public var npcId : int;

/**
*  对话内容索引
*/
public var dialogId : int;

public var options : Array;
--------------------------------------
NPCCommandType
public static const CLOSE_DIALOG : int = 0; //关闭窗口
public static const OPEN_QUEST : int = 1; //打开任务窗口
public static const FINISH_QUEST : int = 2; //完成任务
public static const SHOP : int = 3; //商店
public static const VISIT_NPC : int = 4; //拜访
public static const NPC_TALK : int = 5; //npc对话
public static const NPC_SKILL_LEARN : int = 6; //学习技能
public static const EQUIPMENT : int = 7; //装备打造
public static const GANG : int = 8; //创建门派
public static const GOTO_TingYuan : int = 9; //进入庭院
public static const USER_STORE : int = 10; //用户仓库
public static const RECRUIT_PET : int = 11; //招募战将
public static const HONOR_STORE : int = 13; //荣誉商店
public static const OPEN_CREATE_ARENA : int = 14; //打开摆擂台窗口
public static const OPEN_ARENA_LIST : int = 15; //打开擂台列表窗口
----------------------------------
NPCQuestStatus   任务类型
(0=默认,1=可完成,2=可接,3=未完成,4=不可接)
public static const NONE : int = 0;
public static const CAN_FINISH : int = 1;
public static const CAN_ACCEPT : int = 2;
public static const CANNOT_FINISH : int = 3;
------------------------
ProductInfoVO  产品信息vo
//类型
public var sp_id : int;
//名称
public var name : String;
//所属建筑类型
public var type : int;
//所需建筑等级
public var buildingLevel : int;
//体力
public var health : int;
//金钱
public var money : int;
//时间(秒)
public var time : int;
//图标图片地址
public var iconPath : String;
//物品描述
public var descript : String;
------------------------------------
PhysicItemInfo  药品
public static const KEY_EFFECTS_A : String = "effects_a";
public static const KEY_INTERVAL : String = "interval";
public static const KEY_HP_ADD : String = "hp_add";
public static const KEY_MP_ADD : String = "mp_add";
public static const KEY_STA_ADD : String = "sta_add";
public static const KEY_HP_ADD_PER : String = "hp_add_per";
public static const KEY_MP_ADD_PER : String = "mp_add_per";
public static const KEY_CD : String = "cd";
public static const KEY_CD_TYPE : String = "cdType";
public static const KEY_RELIVE : String = "relive";
PhysicItemInfo(object : Object = null, fireEvent : Boolean = true)
effectsA() 特效
isPetPhysic() 宠物药品
interval() 影响间隔时间(秒)
-------------
PhoenixCode   系统文本编码
public static const CODE_BR : String = "br"; //换行
public static const CODE_EXP : String = "ep"; //表情图片
public static const CODE_COLOR : String = "cl"; //文字颜色

public static const CODE_SYSTEM_ITEM_INFO : String = "is"; //系统物品信息
public static const CODE_ITEM_INFO : String = "ii"; //物品信息
public static const CODE_PLAYER_INFO : String = "pi"; //玩家信息
public static const CODE_SKILL_INFO : String = "si"; //技能信息
public static const CODE_SCENE_LOCATION : String = "sl"; //坐标
public static const CODE_MONSTER : String = "ms"; //MONSTER
public static const CODE_NPC : String = "np"; //NPC
public static const CODE_IMAGE : String = "ig";

public static const CODE_BUILD : String = "bd"; //采集

public static const CODE_OPEN_WINDOW : String = "op"; //打开指定面板
public static const CODE_OPEN_PHYSIQUE : String = "oa"; //打开人物属性界面
public static const CODE_GOTO_SCENE_ITEM : String = "_go"; //疾风令Code, 只在内部用,不公开
public static const CODE_NONE : String = "_";


------------------------------------------
NPCOptionInfo  npc选项内容

public var type : int;

public var npcId : int;

/**
* 对于dialog.xml文件中选项的索引
*/
public var index : int;

/**
* npc命令
* @see NPCCommandType
*/
public var command : int;

/**
* 命令参数,可能为空
*/
public var parameters : Array;
---------------------------------
SystemEquipmentItemType  系统装备道具类型
public static const LOCATION_ARMOR : int = 7;
public static const LOCATION_RIDE : int = 9;
public static const LOCATION_WEAPON : int = 0;

public static const LOCATION_ID0 : int = 0; //武器
public static const LOCATION_ID1 : int = 1; //暗器、符
public static const LOCATION_ID2 : int = 2; //项链
public static const LOCATION_ID3 : int = 3; //戒指
public static const LOCATION_ID4 : int = 4; //戒指
public static const LOCATION_ID5 : int = 5; //锦囊、玉佩
public static const LOCATION_ID6 : int = 6; //头盔
public static const LOCATION_ID7 : int = 7; //衣服
public static const LOCATION_ID8 : int = 8; //鞋子
public static const LOCATION_ID9 : int = 9; //坐骑
----------------------------------------------------
SystemItemInfo 系统物品信息
物品级别 完美普通等
-------------------------------------
SystemEquipmentItemInfo  系统装备物品信息
------------------------
SystemEquipmentPlatItemInfo
------------------------
SystemGemItemInfo 属性宝石
---------------------------------
Tip  关键字以及对应code
public var key : String;
public var id : int;
public var code : String;
--------------------------
SystemPhysicItemInfo  系统药品
---------------------------
SystemItemInfoManager
if (obj[BaseItemInfo.KEY_TYPE] == ItemInfoType.TYPE_Equipment) {
//装备
info = new SystemEquipmentItemInfo(obj);
} else if (obj[BaseItemInfo.KEY_TYPE] == ItemInfoType.TYPE_Physic) {
//药品
info = new SystemPhysicItemInfo(obj);
} else if (obj[BaseItemInfo.KEY_TYPE] == ItemInfoType.TYPE_Gem) {
//属性宝石
info = new SystemGemItemInfo(obj);
} else if (obj[BaseItemInfo.KEY_TYPE] == ItemInfoType.TYPE_Plat) {
//图样
info = new SystemEquipmentPlatItemInfo(obj);
} else { //其他
info = new SystemItemInfo(obj);
}

猜你喜欢

转载自ilovezhurong.iteye.com/blog/1384956