123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <?php
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- namespace loyalsoft;
- /**
- * Description of Ins_GateInfo
- *
- * @author c'y'zhao
- */
- class Ins_GateInfo {
- public $GateId = 0;
- /**
- * 0: 未领取,1: 五分钟奖励已领取 ,2: 十分钟奖励已领取, 3: 通关奖励已领取 (这个必须顺序领取)
- */
- public $FirstReward = 0;
- /**
- * 坚持生存的最长时间(单位秒)
- * @var type
- */
- public $MaxSeconds = 0;
- /**
- * 1:通关
- * @param type $arg
- */
- public $pass = 0;
- /**
- * 本关剧情是否已经播放过 0:没有 1:有
- * @var type
- */
- public $plotStart = 0;
- /**
- * @return bool 是否主线关卡
- */
- public function IsMainPlotGate() {
- return self::GateTypeFromId($this->GateId) == 1;
- }
- /**
- * @return /sm_gate 模板数据
- */
- public function mo() {
- return GameConfig::gate_getItem($this->GateId);
- }
- /**
- * 从gateId中提取关卡类型
- * @param type $gateId
- * @return int 1 主线剧情, 2 主线挑战
- */
- public static function GateTypeFromId($gateId) {
- return Ints::Slice($gateId, 0, 1);
- }
- /**
- * 从gateId中提取关卡索引
- * @param type $gateId
- * @return int 0..999
- */
- public static function GateMapIdFromId($gateId) {
- return Ints::Slice($gateId, 1, 3);
- }
- /**
- * 从gateId中提取地图风格编号
- * @param type $gateId
- * @return int 0..99
- */
- public static function GateMapStyleFromId($gateId) {
- return Ints::Slice($gateId, 4, 2);
- }
- /**
- * 从gateId中提取地图类型
- * @param type $gateId
- * @return int 1 无限地图 2 上下地图 3 有限地图
- */
- public static function GateMapTypeFromId($gateId) {
- return Ints::Slice($gateId, 6, 1);
- }
- /**
- * 从gateId中提取关卡难度(挑战关卡分1,2,3)
- * @param type $gateId
- * @return int
- */
- public static function GateDifficultyFromId($gateId) {
- return Ints::Slice($gateId, 7, 1);
- }
- }
|