|
|
--宠物信息
|
|
PokemonVo = PokemonVo or BaseClass(BaseVo)
|
|
local PokemonVo = PokemonVo
|
|
function PokemonVo:__init()
|
|
end
|
|
|
|
function PokemonVo:__defineVar()
|
|
return {
|
|
_class_type = self,
|
|
--_cid = self._id,
|
|
_iid = _in_obj_ins_id,
|
|
_use_delete_method = false,
|
|
vo_type = SceneBaseType.Pokemon,
|
|
pos_x = 0, --X像素坐标(int16)
|
|
pos_y = 0, --Y像素坐标(int16)
|
|
hp = 100, --当前hp(int32)
|
|
maxHp = 100, --最大hp(int32)
|
|
name = "", --名字(string)
|
|
move_speed = 450, --速度(int16)
|
|
ghost_mode = 0,
|
|
hide_flag = 0, --是否不可见(int8)
|
|
warGroup = 0, --战斗分组(int8)
|
|
pokemon_id = 0, --ID(int32)
|
|
pokemon_star = 0, --宠物阶数
|
|
model_id = 0, --模型id
|
|
texture_res = 0, --贴图
|
|
poseState = PoseState.STAND,
|
|
birth_angle = 270, --出生角度 水平向右为0 逆时针一圈为360度
|
|
owner_id = 0, --所属玩家id
|
|
}
|
|
end
|
|
|
|
function PokemonVo:SetVo(owner_id, pokemon_id,pokemon_star)
|
|
self.owner_id = owner_id
|
|
self.pokemon_id = pokemon_id
|
|
self.pokemon_star = pokemon_star
|
|
self.texture_res = 0
|
|
end
|
|
|
|
--取模型id
|
|
function PokemonVo:GetPokemonClotheId()
|
|
local cfg = Config.Pet
|
|
|
|
if cfg then
|
|
local key = self.pokemon_id.."@"..self.pokemon_star
|
|
return cfg[key] and cfg[key].figure_id or 0
|
|
end
|
|
return 0
|
|
end
|
|
|
|
function PokemonVo:GetTextureId()
|
|
if tonumber(self.texture_res) ~= 0 then
|
|
return self:GetPokemonClotheId() .. "_" .. self.texture_res
|
|
end
|
|
end
|
|
|
|
function PokemonVo:__delete()
|
|
end
|