源战役客户端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

117 行
3.2 KiB

  1. --宝宝信息
  2. BabyVo = BabyVo or BaseClass(BaseVo)
  3. function BabyVo:__init()
  4. self.model = ChildModel:GetInstance()
  5. end
  6. function BabyVo:__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.Baby,
  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 = 160, --速度(int16)
  19. ghost_mode = 0,
  20. hide_flag = 0 , --是否不可见(int8)
  21. warGroup = 0, --战斗分组(int8)
  22. baby_id = 0, --宝宝ID(int32)
  23. model_id = 0, --模型id
  24. texture_res = 0, --贴图
  25. poseState = PoseState.STAND,
  26. birth_angle = 200, --出生角度 水平向右为0 逆时针一圈为360度
  27. owner_id = 0, --所属玩家id
  28. horse_id = 0, --坐骑ID(int32)
  29. }
  30. end
  31. function BabyVo:SetVo(owner_id, owner_vo,baby_id)
  32. self.owner_id = owner_id
  33. self.owner_vo = owner_vo
  34. --self.baby_id = tonumber(Config.Babyconstant[3].constant) --baby_id
  35. self.baby_id = 1790101
  36. self.texture_res = 0
  37. end
  38. --取模型id
  39. function BabyVo:GetBabyClotheId()
  40. return self.model:GetChildClothByParam( self.owner_vo.child_ageMonth,
  41. self.owner_vo.child_sex, self.model:GetChildFashionID( self.owner_vo.child_fashion ) )
  42. --return self.model:GetChildCloth(self.owner_vo.child_heartLinkLevel,self.owner_vo.child_ageMonth) or 0
  43. end
  44. -----这等待资源再修改
  45. function BabyVo:GetTextureId()
  46. if tonumber(self.texture_res) ~= 0 then
  47. return self:GetBabyClotheId() .. "_" .. self.texture_res
  48. end
  49. end
  50. ---获取孩子坐骑
  51. function BabyVo:GetBabyHorseModelId( )
  52. if self.owner_vo then
  53. if self.owner_vo.child_vehicle_id then
  54. local vehicle_id = self.owner_vo.child_vehicle_id
  55. return (vehicle_id == 0) and 0 or self.model:GetVehicleModelID(vehicle_id)
  56. end
  57. end
  58. end
  59. -- 获取当前坐骑所需要的宝宝形象
  60. function BabyVo:GetBabyHorseOnStageClotheId( )
  61. if self.owner_vo then
  62. if self.owner_vo.child_vehicle_id then
  63. local can_on_age = Config.Childvehicle[self.owner_vo.child_vehicle_id .. "@" .. 1].can_on_age
  64. local cur_state = self.model:GetChildStateByAge(self.owner_vo.child_ageMonth)
  65. if cur_state > can_on_age then -- 小于状态 就走默认
  66. return self.model:GetBaseChildModelID( can_on_age, self.owner_vo.child_sex )
  67. end
  68. end
  69. end
  70. return self:GetBabyFashionModelId()
  71. end
  72. --获取孩子装扮
  73. function BabyVo:GetBabyFashionModelId( )
  74. if self.owner_vo then
  75. if self.owner_vo.child_fashion then
  76. local fashion_list = self.owner_vo.child_fashion
  77. return (fashion_list[1] and fashion_list[1].fashion_id) and fashion_list[1].fashion_id or 0
  78. end
  79. end
  80. end
  81. --获取孩子性别
  82. function BabyVo:GetBabySex( )
  83. if self.owner_vo then
  84. if self.owner_vo.child_sex then
  85. return self.owner_vo.child_sex
  86. end
  87. end
  88. end
  89. --[[ 现版本无特效跟随时装变化设定
  90. function BabyVo:GetBabySkillId( )
  91. if self.owner_vo then
  92. local skil_id = nil
  93. local model_id = self:GetBabyFashionModelId()
  94. if model_id ~= 0 then
  95. skil_id = BabyModel:getInstance():GetBabySkillInfo(model_id)
  96. else
  97. skil_id = BabyModel:getInstance():GetBabySkillInfo(self.baby_id)
  98. end
  99. return skil_id
  100. end
  101. end]]
  102. function BabyVo:__delete()
  103. end