Ins_GateInfo.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?php
  2. /*
  3. * To change this license header, choose License Headers in Project Properties.
  4. * To change this template file, choose Tools | Templates
  5. * and open the template in the editor.
  6. */
  7. namespace loyalsoft;
  8. /**
  9. * Description of Ins_GateInfo
  10. *
  11. * @author c'y'zhao
  12. */
  13. class Ins_GateInfo extends Object_ext {
  14. public $GateId = 0;
  15. /**
  16. * 0: 未领取,1: 五分钟奖励已领取 ,2: 十分钟奖励已领取, 3: 通关奖励已领取
  17. */
  18. #[ArrayType]
  19. public $FirstReward = array();
  20. /**
  21. * 坚持生存的最长时间(单位秒)
  22. * @var type
  23. */
  24. public $MaxSeconds = 0;
  25. /**
  26. * 1:通关
  27. * @param type $arg
  28. */
  29. public $pass = 0;
  30. /**
  31. * 本关剧情是否已经播放过 0:没有 1:有
  32. * @var type
  33. */
  34. public $plotStart = 0;
  35. /**
  36. * 本关挑战次数
  37. * @var type
  38. */
  39. public $fightNum = 0;
  40. /**
  41. * 失败次数
  42. * @var type
  43. */
  44. public $fightNum_fail = 0;
  45. /**
  46. * 0/1/2/3 (0未挑战, 1/2/3代表已经通过的挑战)
  47. * @var int
  48. */
  49. public $tz_state = 0;
  50. /**
  51. * 0/1/2/3/4/5/6 挑战奖励(一次性)领取记录
  52. * @var int
  53. */
  54. public $tz_rewards = 0;
  55. /**
  56. * @return bool 是否主线关卡
  57. */
  58. public function IsMainPlotGate() {
  59. return self::GateTypeFromId($this->GateId) == 1;
  60. }
  61. /**
  62. * @return /sm_gate 模板数据
  63. */
  64. public function mo() {
  65. return GameConfig::gate_getItem($this->GateId);
  66. }
  67. /**
  68. * 从gateId中提取关卡类型
  69. * @param type $gateId
  70. * @return int 1 主线剧情, 2 主线挑战, 9 爬塔挑战
  71. */
  72. public static function GateTypeFromId($gateId) {
  73. return Ints::Slice($gateId, 0, 1);
  74. }
  75. // /**
  76. // * 从gateId中提取关卡地图资源类型(前端用)
  77. // * @param type $gateId 1 无限地图 2 上下地图 3 有限地图
  78. // * @return int 0..999
  79. // */
  80. // public static function GateMapRes($gateId) {
  81. // return Ints::Slice($gateId, 1, 4);
  82. // }
  83. // /**
  84. // * 从gateId中提取关卡难度(挑战关卡分1,2,3)
  85. // * @param type $gateId
  86. // * @return int
  87. // */
  88. // public static function GateDifficultyFromId($gateId) {
  89. // return Ints::Slice($gateId, 5, 1);
  90. // }
  91. /**
  92. * 关卡序号(最大999)
  93. * @param type $gateId
  94. * @return int
  95. */
  96. public static function gateNum($gateId) {
  97. return $gateId % 1000;
  98. // return Ints::Slice($gateId, 6, 3);
  99. }
  100. }