源战役客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.6 KiB

  1. --宠物信息
  2. StarSoulVo = StarSoulVo or BaseClass(BaseVo)
  3. local StarSoulVo = StarSoulVo
  4. function StarSoulVo:__init()
  5. end
  6. function StarSoulVo:__defineVar()
  7. return {
  8. _class_type = self,
  9. --_cid = self._id,
  10. _iid = _in_obj_ins_id,
  11. _use_delete_method = false,
  12. vo_type = SceneBaseType.StarSoul,
  13. pos_x = 0, --X像素坐标(int16)
  14. pos_y = 0, --Y像素坐标(int16)
  15. hp = 100, --当前hp(int32)
  16. maxHp = 100, --最大hp(int32)
  17. name = "", --名字(string)
  18. move_speed = 450, --速度(int16)
  19. ghost_mode = 0,
  20. hide_flag = 0, --是否不可见(int8)
  21. warGroup = 0, --战斗分组(int8)
  22. follow_pet_id = 0, --ID(int32)
  23. follow_pet_stage = 0, --宠物阶数
  24. model_id = 0, --模型id
  25. texture_res = 0, --贴图
  26. poseState = PoseState.STAND,
  27. birth_angle = 270, --出生角度 水平向右为0 逆时针一圈为360度
  28. owner_id = 0, --所属玩家id
  29. }
  30. end
  31. function StarSoulVo:SetVo(owner_id, follow_pet_id,follow_pet_stage)
  32. self.owner_id = owner_id
  33. self.follow_pet_id = follow_pet_id
  34. self.follow_pet_stage = follow_pet_stage
  35. self.texture_res = 0
  36. end
  37. --取模型id
  38. function StarSoulVo:GetStarSoulClotheId()
  39. local cfg = Config.Pet
  40. if cfg then
  41. local key = self.follow_pet_id.."@"..self.follow_pet_stage.."@1"
  42. return cfg[key] and cfg[key].figure_id or 0
  43. end
  44. return 0
  45. end
  46. function StarSoulVo:GetTextureId()
  47. if tonumber(self.texture_res) ~= 0 then
  48. return self:GetStarSoulClotheId() .. "_" .. self.texture_res
  49. end
  50. end
  51. function StarSoulVo:__delete()
  52. end