源战役客户端
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

92 rader
3.0 KiB

4 veckor sedan
  1. --[[@------------------------------------------------------------------
  2. @description:Vo
  3. @author:wyb
  4. ----------------------------------------------------------------------]]
  5. GraveVo = GraveVo or BaseClass(BaseVo)
  6. local GraveVo= GraveVo
  7. function GraveVo:__init()
  8. end
  9. function GraveVo:__defineVar()
  10. return {
  11. _class_type = self,
  12. --_cid = self._id,
  13. _iid = _in_obj_ins_id,
  14. _use_delete_method = false,
  15. vo_type = SceneBaseType.Grave,
  16. pos_x = 0, --X像素坐标(int16)
  17. pos_y = 0, --Y像素坐标(int16)
  18. hp = 100, --当前hp(int32)
  19. maxHp = 100, --最大hp(int32)
  20. name = "", --名字(string)
  21. move_speed = 160, --速度(int16)
  22. level = 1, --怪物等级(int16)
  23. ghost_mode = 0,
  24. hide_flag = 0, --是否不可见(int8)
  25. warGroup = 0, --战斗分组(int8)
  26. type_id = 0, --墓碑怪物id
  27. boss_id = 0, --墓碑所属怪物id
  28. texture_res = 0, --贴图
  29. poseState = PoseState.STAND,
  30. birth_angle = 0, --出生角度 水平向右为0 逆时针一圈为360度
  31. refresh_time = 0, --倒计时时间
  32. effect_res = "effect_bossmubei",
  33. }
  34. end
  35. function GraveVo:SetGraveVo(vo)
  36. self.instance_id = vo.boss_id --怪物唯一标识(int32)
  37. self.type_id = vo.type_id
  38. self.boss_id = vo.boss_id
  39. self.pos_x = vo.pos_x
  40. self.pos_y = vo.pos_y
  41. self.level = vo.level
  42. self.name = vo.name
  43. self.refresh_time = vo.refresh_time
  44. self:SetBasePropertyFromConfig()
  45. end
  46. function GraveVo:SetBasePropertyFromConfig()
  47. self:CacheCfgData()
  48. if self.cfg_data == nil then
  49. return
  50. end
  51. self.monster_res = self.cfg_data.icon
  52. self.texture_res = self.cfg_data.icon_texture
  53. self.is_armor=self.cfg_data.is_armor or 0 --是否霸体
  54. --print("怪物资源缩放:", self.cfg_data.icon_scale, tonumber(self.cfg_data.icon_scale))
  55. self.icon_scale = tonumber(self.cfg_data.icon_scale)
  56. self.is_blood_bar = tonumber(self.cfg_data.is_blood_bar)
  57. self.color = tonumber(self.cfg_data.color)
  58. if self.birth_angle == 0 then
  59. self.birth_angle = tonumber(self.cfg_data.direction)
  60. if self.birth_angle == -1 then
  61. self.birth_angle = nil
  62. end
  63. end
  64. self.birth_effect_res = Trim(self.cfg_data.mon_state) or "" --出生特效
  65. self.foot_effect_res = Trim(self.cfg_data.foot_icon) or "" --脚下特效
  66. self.classification = Trim(self.cfg_data.classification) or "" --怪物分类名字
  67. self.load_immediately = tonumber(self.cfg_data.load_immediately) or 0 --是否立即加载怪物
  68. self.is_hit_ac = tonumber(self.cfg_data.is_hit_ac) or 0 --是否需要受击动作
  69. self.is_hide_hp = (self.cfg_data.is_hide_hp==1)
  70. -- print("怪物显示血条名字怪物显示血条名字", self.name, self.is_hide_hp, self.birth_angle == -1 , self.is_hit_ac, self.is_hit_ac ~= 0)
  71. end
  72. function GraveVo:CacheCfgData()
  73. if self.cfg_data == nil then
  74. self.cfg_data = ConfigItemMgr.Instance:GetMonsterDataItem(self.type_id)
  75. end
  76. end
  77. function GraveVo:GetFashionTextureId()
  78. if tonumber(self.texture_res) ~= 0 then
  79. return self.monster_res .. "_" .. self.texture_res
  80. end
  81. end
  82. function GraveVo:__delete()
  83. end