--[[@------------------------------------------------------------------ @description:墓碑Vo @author:wyb ----------------------------------------------------------------------]] GraveVo = GraveVo or BaseClass(BaseVo) local GraveVo= GraveVo function GraveVo:__init() end function GraveVo:__defineVar() return { _class_type = self, --_cid = self._id, _iid = _in_obj_ins_id, _use_delete_method = false, vo_type = SceneBaseType.Grave, pos_x = 0, --X像素坐标(int16) pos_y = 0, --Y像素坐标(int16) hp = 100, --当前hp(int32) maxHp = 100, --最大hp(int32) name = "", --名字(string) move_speed = 160, --速度(int16) level = 1, --怪物等级(int16) ghost_mode = 0, hide_flag = 0, --是否不可见(int8) warGroup = 0, --战斗分组(int8) type_id = 0, --墓碑怪物id boss_id = 0, --墓碑所属怪物id texture_res = 0, --贴图 poseState = PoseState.STAND, birth_angle = 0, --出生角度 水平向右为0 逆时针一圈为360度 refresh_time = 0, --倒计时时间 effect_res = "effect_bossmubei", } end function GraveVo:SetGraveVo(vo) self.instance_id = vo.boss_id --怪物唯一标识(int32) self.type_id = vo.type_id self.boss_id = vo.boss_id self.pos_x = vo.pos_x self.pos_y = vo.pos_y self.level = vo.level self.name = vo.name self.refresh_time = vo.refresh_time self:SetBasePropertyFromConfig() end function GraveVo:SetBasePropertyFromConfig() self:CacheCfgData() if self.cfg_data == nil then return end self.monster_res = self.cfg_data.icon self.texture_res = self.cfg_data.icon_texture self.is_armor=self.cfg_data.is_armor or 0 --是否霸体 --print("怪物资源缩放:", self.cfg_data.icon_scale, tonumber(self.cfg_data.icon_scale)) self.icon_scale = tonumber(self.cfg_data.icon_scale) self.is_blood_bar = tonumber(self.cfg_data.is_blood_bar) self.color = tonumber(self.cfg_data.color) if self.birth_angle == 0 then self.birth_angle = tonumber(self.cfg_data.direction) if self.birth_angle == -1 then self.birth_angle = nil end end self.birth_effect_res = Trim(self.cfg_data.mon_state) or "" --出生特效 self.foot_effect_res = Trim(self.cfg_data.foot_icon) or "" --脚下特效 self.classification = Trim(self.cfg_data.classification) or "" --怪物分类名字 self.load_immediately = tonumber(self.cfg_data.load_immediately) or 0 --是否立即加载怪物 self.is_hit_ac = tonumber(self.cfg_data.is_hit_ac) or 0 --是否需要受击动作 self.is_hide_hp = (self.cfg_data.is_hide_hp==1) -- print("怪物显示血条名字怪物显示血条名字", self.name, self.is_hide_hp, self.birth_angle == -1 , self.is_hit_ac, self.is_hit_ac ~= 0) end function GraveVo:CacheCfgData() if self.cfg_data == nil then self.cfg_data = ConfigItemMgr.Instance:GetMonsterDataItem(self.type_id) end end function GraveVo:GetFashionTextureId() if tonumber(self.texture_res) ~= 0 then return self.monster_res .. "_" .. self.texture_res end end function GraveVo:__delete() end