123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- <?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 Info_Store
- *
- * @author c'y'zhao
- */
- class Info_Store extends Object_ext {
- /**
- * 道具
- * @var \stdClass()
- */
- public $items;
- /**
- * 宝石在背包库的唯一id
- * @var type
- */
- public $gemLength = 0;
- /**
- * 宝石背包
- * \stdClass()
- */
- public $gemStore;
- /**
- * 装备界面默认页
- * @var int
- */
- public $equipPag = 1;
- /**
- * 装备背包数据
- * @var \stdClass()
- */
- public $equip;
- /**
- * 装备部位--废弃
- * @var \stdClass()
- */
- public $equipPosition;
- /**
- * 6个装备部位
- * @var type
- */
- public $equipLocation;
- /**
- * 宝石装备的信息--废弃
- * @var \stdClass()
- */
- public $gemEquip;
- /**
- * 装备信息 装备不跟hero走--废弃
- * @var type
- */
- //public $equipPosition = null;
- public $gemComposeNum = 0;
- /**
- * @var int current UID
- */
- public $cuid = 10000;
-
-
- /**
- * @var int $petUid
- */
- public $petUid = 1;
-
- /**
- * 宠物背包数据
- */
- public $pet;
- /**
- * 选中要在主界面显示的灵宠
- */
- #[ArrayType]
- public $mainShowPetList = array();
- /**
- * 出战位置 宠物id
- * @var type
- */
- public $petUid_fight_position = 0;
- /**
- * 助战
- * @var type
- */
- public $petUids_supportFight_position;
-
- /**
- * 孵蛋坑位信息
- * @var type
- */
- public $breedEggLocation;
-
- /**
- * 宠物探索区域
- * @var type
- */
- public $exploreArea;
- public function initialize() {
- StoreProc::AddMultiItemInStore(glc()->Init_Packet_Items, "UsrInit");
- }
- public function __construct($arg = null) {
- if ($arg == null) {
- $this->exploreArea = new \stdClass();
- $this->petUids_supportFight_position = new \stdClass();
-
- $this->items = new \stdClass();
- $this->gemStore = new \stdClass();
- $this->equip = new \stdClass();
- $this->equipLocation = new \stdClass();
- $this->pet = new \stdClass();
- $this->equipPosition = new \stdClass();
- for ($i = 1; $i <= 6; $i++) {
- $equip = new Ins_EquipPosition();
- $equip->typeId = $i;
- $this->equipPosition->$i = $equip;
- }
- $this->gemEquip = new \stdClass();
- for ($k = 1; $k <= 3; $k++) {
- $item = new \stdClass();
- for ($j = 1; $j <= 6; $j++) {
- $item->$j = new \stdClass();
- }
- $this->gemEquip->$k = $item;
- }
-
- $str = GameConfig::glc2()->Pet_BreedLocationUnlockInfo;
- $this->breedEggLocation = new \stdClass();
- if($str != null){
- $list = explode(';', $str);
- foreach ($list as $value) {
- $s = explode(',', $value);
- $k = $s[0];
- $ins_breed = new Ins_BreedEggSlot();
- $ins_breed->uid = $k;
- $ins_breed->unlock = 0;
- if($s[1] == 0){
- $ins_breed->unlock = 1;
- }
- $this->breedEggLocation->$k = $ins_breed;
- }
- }
-
- } else {
- parent::__construct($arg);
- }
- }
- public function removeItem($itemId, $num) {
- if (StlUtil::dictHasProperty($this->items, $itemId)) {
- $this->items->$itemId -= $num;
- if ($this->items->$itemId <= 0) {
- unset($this->items->$itemId);
- }
- }
- }
- /**
- * @return 产生下一个唯一ID
- */
- public function nextUID() {
- return $this->cuid++;
- }
- }
|