UserHeroModel.php 2.7 KB

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