|
|
-
- --宝宝信息
- BabyVo = BabyVo or BaseClass(BaseVo)
-
- function BabyVo:__init()
- self.model = ChildModel:GetInstance()
- end
-
- function BabyVo:__defineVar()
- return {
- _class_type = self,
- --_cid = self._id,
- _iid = _in_obj_ins_id,
- _use_delete_method = false,
- vo_type = SceneBaseType.Baby,
- pos_x = 0, --X像素坐标(int16)
- pos_y = 0, --Y像素坐标(int16)
- hp = 100, --当前hp(int32)
- maxHp = 100, --最大hp(int32)
- name = "", --名字(string)
- move_speed = 160, --速度(int16)
- ghost_mode = 0,
- hide_flag = 0 , --是否不可见(int8)
- warGroup = 0, --战斗分组(int8)
- baby_id = 0, --宝宝ID(int32)
- model_id = 0, --模型id
- texture_res = 0, --贴图
- poseState = PoseState.STAND,
- birth_angle = 200, --出生角度 水平向右为0 逆时针一圈为360度
- owner_id = 0, --所属玩家id
- horse_id = 0, --坐骑ID(int32)
- }
- end
-
- function BabyVo:SetVo(owner_id, owner_vo,baby_id)
- self.owner_id = owner_id
- self.owner_vo = owner_vo
- --self.baby_id = tonumber(Config.Babyconstant[3].constant) --baby_id
- self.baby_id = 1790101
- self.texture_res = 0
- end
-
- --取模型id
- function BabyVo:GetBabyClotheId()
- return self.model:GetChildClothByParam( self.owner_vo.child_ageMonth,
- self.owner_vo.child_sex, self.model:GetChildFashionID( self.owner_vo.child_fashion ) )
- --return self.model:GetChildCloth(self.owner_vo.child_heartLinkLevel,self.owner_vo.child_ageMonth) or 0
- end
-
-
- -----这等待资源再修改
- function BabyVo:GetTextureId()
- if tonumber(self.texture_res) ~= 0 then
- return self:GetBabyClotheId() .. "_" .. self.texture_res
- end
- end
-
- ---获取孩子坐骑
- function BabyVo:GetBabyHorseModelId( )
- if self.owner_vo then
- if self.owner_vo.child_vehicle_id then
- local vehicle_id = self.owner_vo.child_vehicle_id
- return (vehicle_id == 0) and 0 or self.model:GetVehicleModelID(vehicle_id)
- end
- end
- end
-
- -- 获取当前坐骑所需要的宝宝形象
- function BabyVo:GetBabyHorseOnStageClotheId( )
- if self.owner_vo then
- if self.owner_vo.child_vehicle_id then
- local can_on_age = Config.Childvehicle[self.owner_vo.child_vehicle_id .. "@" .. 1].can_on_age
- local cur_state = self.model:GetChildStateByAge(self.owner_vo.child_ageMonth)
- if cur_state > can_on_age then -- 小于状态 就走默认
- return self.model:GetBaseChildModelID( can_on_age, self.owner_vo.child_sex )
- end
- end
- end
- return self:GetBabyFashionModelId()
- end
-
- --获取孩子装扮
- function BabyVo:GetBabyFashionModelId( )
- if self.owner_vo then
- if self.owner_vo.child_fashion then
- local fashion_list = self.owner_vo.child_fashion
- return (fashion_list[1] and fashion_list[1].fashion_id) and fashion_list[1].fashion_id or 0
- end
- end
- end
-
-
- --获取孩子性别
- function BabyVo:GetBabySex( )
- if self.owner_vo then
- if self.owner_vo.child_sex then
- return self.owner_vo.child_sex
- end
- end
- end
-
- --[[ 现版本无特效跟随时装变化设定
- function BabyVo:GetBabySkillId( )
- if self.owner_vo then
- local skil_id = nil
- local model_id = self:GetBabyFashionModelId()
- if model_id ~= 0 then
- skil_id = BabyModel:getInstance():GetBabySkillInfo(model_id)
- else
- skil_id = BabyModel:getInstance():GetBabySkillInfo(self.baby_id)
- end
- return skil_id
- end
- end]]
-
-
- function BabyVo:__delete()
- end
|