UserHeroModel.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <?php
  2. namespace loyalsoft;
  3. /**
  4. * 玩家的英雄的实体数据
  5. */
  6. class UserHeroModel
  7. {
  8. /**
  9. * 唯一的英雄ID
  10. * @var string
  11. */
  12. public $uid;
  13. /**
  14. * 英雄的模板ID
  15. * @var string
  16. */
  17. public $modelId;
  18. /**
  19. * 英雄的当前等级
  20. * @var int
  21. */
  22. public $level;
  23. /**
  24. * 英雄的收集的当前等级满级的累计经验值
  25. * @var int
  26. */
  27. public $maxXp;
  28. /**
  29. * 英雄的当前总经验值
  30. * @var int
  31. */
  32. public $xp;
  33. /**
  34. * 当前等阶 默认是0.
  35. * 0= 绿 1=蓝 2= 红 3= 紫 4= 橙 5
  36. * @var int
  37. */
  38. public $strengthLevel;
  39. /**
  40. * 当前星级 默认是0星
  41. * @var int
  42. */
  43. public $curStar;
  44. /**
  45. * 当前神血的 血脉等级 默认是0
  46. * @var int
  47. */
  48. public $curBloodId;
  49. /**
  50. * 当前卡牌的锁定状态
  51. * true = 锁定
  52. * @var bool
  53. */
  54. public $isLocked;
  55. /**
  56. *
  57. * @var object
  58. */
  59. public $skills;
  60. /**
  61. *
  62. * @var object
  63. */
  64. public $equip;
  65. /**
  66. * 当前主线的好感度进度
  67. * @var object
  68. */
  69. public $curMainFavor;
  70. /**
  71. * 所有的已经拥有的好感度进度
  72. * @var array
  73. */
  74. public $favors;
  75. /**
  76. *
  77. * 构造函数
  78. */
  79. public function __construct()
  80. {
  81. $this->level = 1;
  82. $this->xp = 0;
  83. $this->maxXp = 0;
  84. $this->strengthLevel = 0;
  85. $this->curBloodId = 0;
  86. $this->curStar = 0;
  87. $this->isLocked = false;
  88. $this->curMainFavor = 'E';
  89. $this->favors = ArrayInit();
  90. $this->favors[] = 'E';
  91. //-----------初始化技能的默认数据
  92. $this->skills = ObjectInit();
  93. $temp = ObjectInit();
  94. $temp->normalSkill = JsonUtil::decode('{"level":1}');
  95. $temp->manuSkill1 = JsonUtil::decode('{"level":1}');
  96. $temp->manuSkill2 = JsonUtil::decode('{"level":1}');
  97. $temp->manuSkill3 = JsonUtil::decode('{"level":1}');
  98. $temp->passiveSkill = JsonUtil::decode('{"level":1}');
  99. $temp->captainSkill = JsonUtil::decode('{"level":1}');
  100. $this->skills = $temp;
  101. //----初始化装备的默认数据
  102. $this->equip = ObjectInit();
  103. $tempEq = ObjectInit();
  104. $tempEq->weapon = JsonUtil::decode('{"itemuid":0}');
  105. $tempEq->armor = JsonUtil::decode('{"itemuid":0}');
  106. $tempEq->ring = JsonUtil::decode('{"itemuid":0}');
  107. $this->equip = $tempEq;
  108. }
  109. }