Ins_GateInfo.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. * @return bool 是否主线关卡
  42. */
  43. public function IsMainPlotGate() {
  44. return self::GateTypeFromId($this->GateId) == 1;
  45. }
  46. /**
  47. * @return /sm_gate 模板数据
  48. */
  49. public function mo() {
  50. return GameConfig::gate_getItem($this->GateId);
  51. }
  52. /**
  53. * 从gateId中提取关卡类型
  54. * @param type $gateId
  55. * @return int 1 主线剧情, 2 主线挑战, 9 爬塔挑战
  56. */
  57. public static function GateTypeFromId($gateId) {
  58. return Ints::Slice($gateId, 0, 1);
  59. }
  60. /**
  61. * 从gateId中提取关卡地图资源类型(前端用)
  62. * @param type $gateId 1 无限地图 2 上下地图 3 有限地图
  63. * @return int 0..999
  64. */
  65. public static function GateMapRes($gateId) {
  66. return Ints::Slice($gateId, 1, 4);
  67. }
  68. /**
  69. * 从gateId中提取关卡难度(挑战关卡分1,2,3)
  70. * @param type $gateId
  71. * @return int
  72. */
  73. public static function GateDifficultyFromId($gateId) {
  74. return Ints::Slice($gateId, 5, 1);
  75. }
  76. /**
  77. * 关卡序号(最大999)
  78. * @param type $gateId
  79. * @return int
  80. */
  81. public static function gateNum($gateId) {
  82. return Ints::Slice($gateId, 6, 3);
  83. }
  84. }