displayHeroUID = null; $this->firendSupportHeroUID = null; $this->maxCollectCount = glc()->Game_CollectHero_BasicMaxCount; $this->recordMaxUID = 0; $this->collectHeros = ObjectInit(); # 初始化英雄集合 $hids = GameConfig::primordial_data()->User_Heros; # 设置初始英雄 my_Assert(null != $hids, ErrCode::err_const_no); foreach ($hids as $heroModelId_yanlingid) { list($heroModelId, $yanlingId) = explode('_', $heroModelId_yanlingid); $uid = HeroProc::CreateNewGameHeroUID($this->collectHeros, $this->recordMaxUID); $this->recordMaxUID = $uid; $hero = HeroProc::getGameHeroModelInstance($heroModelId, $uid); StatisticsProc::TargetStatistics(Enum_TargetStatistics::HuanLingShiId_UserNum, $heroModelId); StatisticsProc::TargetStatistics(Enum_TargetStatistics::HuanLingShiLevel_UserNum, $heroModelId,"1"); // // 初始化言灵 // $yanlingMo = GameConfig::item_yanling_getItem($yanlingId); // my_Assert(null != $yanlingMo, ErrCode::err_const_no); // $yl_uid = StoreProc::PutYanLingInStore($yanlingMo->typeId, req()); // ctx()->store->yanling->$yl_uid->herouid = $uid; // $position = $yanlingMo->position; // $hero->yanling->$position = array("itemuid" => $yl_uid); # 装备位置 $this->collectHeros->$uid = $hero; $this->displayHeroUID = $uid; $this->firendSupportHeroUID = $uid; } } /** * * @param type $heroMoId */ public function GetHeroByMoID($heroMoId) { my_Assert(null != $this->collectHeros, ErrCode::err_innerfault); foreach ($this->collectHeros as $hid => $hero) { isEditor() and $hero = new Ins_UserHero(); if ($hero->typeId == $heroMoId) { return $hero; } } return null; } }