|
@@ -64,7 +64,7 @@ class ActiveProc {
|
|
static function GetShenmiaoData() {
|
|
static function GetShenmiaoData() {
|
|
$req = req();
|
|
$req = req();
|
|
//$shenmiaoInfo = $req->userInfo->game->shenmiao;
|
|
//$shenmiaoInfo = $req->userInfo->game->shenmiao;
|
|
-
|
|
|
|
|
|
+
|
|
$shenmiaoInfo = new Info_ShenMiao($req->userInfo->game->shenmiao);
|
|
$shenmiaoInfo = new Info_ShenMiao($req->userInfo->game->shenmiao);
|
|
$shenmiaoInfo->initActiveItem();
|
|
$shenmiaoInfo->initActiveItem();
|
|
$req->userInfo->game->shenmiao = $shenmiaoInfo;
|
|
$req->userInfo->game->shenmiao = $shenmiaoInfo;
|
|
@@ -110,7 +110,7 @@ class ActiveProc {
|
|
$tag = true;
|
|
$tag = true;
|
|
}
|
|
}
|
|
if($n==10 && $tag == false && $shenmiaoInfo->activeDic->$type->totalNum > 10){
|
|
if($n==10 && $tag == false && $shenmiaoInfo->activeDic->$type->totalNum > 10){
|
|
- $list[] =self::getActiveRandomItem(self::randSsrUr($shenmo->per), $shenmo);
|
|
|
|
|
|
+ $list[] =self::getActiveRandomItem(Enum_ActiveItemType::Ssr, $shenmo);//self::randSsrUr($shenmo->per)
|
|
} else {
|
|
} else {
|
|
if($shenmiaoInfo->activeDic->$type->totalNum <= 10){
|
|
if($shenmiaoInfo->activeDic->$type->totalNum <= 10){
|
|
$itemType = Enum_ActiveItemType::Sr;
|
|
$itemType = Enum_ActiveItemType::Sr;
|
|
@@ -157,7 +157,7 @@ class ActiveProc {
|
|
$tag = true;
|
|
$tag = true;
|
|
}
|
|
}
|
|
if($n==10 && $tag == false){
|
|
if($n==10 && $tag == false){
|
|
- $list[] =self::getActiveRandomItem(self::randSsrUr($shenmo->per), $shenmo);
|
|
|
|
|
|
+ $list[] =self::getActiveRandomItem(Enum_ActiveItemType::Ssr, $shenmo);//self::randSsrUr($shenmo->per)
|
|
} else {
|
|
} else {
|
|
$list[] =self::getActiveRandomItem($itemType, $shenmo);
|
|
$list[] =self::getActiveRandomItem($itemType, $shenmo);
|
|
}
|
|
}
|
|
@@ -178,11 +178,10 @@ class ActiveProc {
|
|
$itemType = self::activeRandom($shenmo->per, $shenmo);
|
|
$itemType = self::activeRandom($shenmo->per, $shenmo);
|
|
$aid =self::getActiveRandomItem_3($itemType, $shenmo,$type);//随机出的id
|
|
$aid =self::getActiveRandomItem_3($itemType, $shenmo,$type);//随机出的id
|
|
if($shenmiaoInfo->activeDic->$type->num% glc()->Active_UR_Num == 0){
|
|
if($shenmiaoInfo->activeDic->$type->num% glc()->Active_UR_Num == 0){
|
|
- $aid =self::getActiveRandomItem_3(Enum_ActiveItemType::Ur, $shenmo,$type);
|
|
|
|
- $list[] = $aid;
|
|
|
|
- } else {
|
|
|
|
- $list[] = $aid;
|
|
|
|
- }
|
|
|
|
|
|
+ $aid =self::getActiveRandomItem_3(Enum_ActiveItemType::Ur, $shenmo,$type);
|
|
|
|
+ }
|
|
|
|
+ $list[] = $aid;
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
$sList = explode(',', $shenmo->cost);
|
|
$sList = explode(',', $shenmo->cost);
|
|
StoreProc::removeItemFromStore($req->userInfo->game->store,$sList[0],$sList[1]*$num);
|
|
StoreProc::removeItemFromStore($req->userInfo->game->store,$sList[0],$sList[1]*$num);
|
|
@@ -198,7 +197,7 @@ class ActiveProc {
|
|
$tag = true;
|
|
$tag = true;
|
|
}
|
|
}
|
|
if($n==10 && $tag == false){
|
|
if($n==10 && $tag == false){
|
|
- $list[] =self::getActiveRandomItem_3(self::randSsrUr($shenmo->per), $shenmo,$type);
|
|
|
|
|
|
+ $list[] =self::getActiveRandomItem_3(Enum_ActiveItemType::Ssr, $shenmo,$type);//self::randSsrUr($shenmo->per)
|
|
} else {
|
|
} else {
|
|
$list[] =self::getActiveRandomItem_3($itemType, $shenmo,$type);
|
|
$list[] =self::getActiveRandomItem_3($itemType, $shenmo,$type);
|
|
}
|
|
}
|
|
@@ -399,19 +398,20 @@ class ActiveProc {
|
|
public static function randSsrUr($randCtx) {
|
|
public static function randSsrUr($randCtx) {
|
|
$list = explode(',', $randCtx);
|
|
$list = explode(',', $randCtx);
|
|
$list = array_splice($list,1);
|
|
$list = array_splice($list,1);
|
|
- $total = $list[0]+$list[1];
|
|
|
|
-
|
|
|
|
- $rand = rand(1,$total);
|
|
|
|
- $start = 0;
|
|
|
|
- $type = Enum_ActiveItemType::Ssr;
|
|
|
|
|
|
+ $total = $list[0]+$list[1];
|
|
|
|
+
|
|
|
|
+ $rand = rand(1,$total);
|
|
|
|
+ $start = 0;
|
|
|
|
+ //$type = Enum_ActiveItemType::Ssr;
|
|
|
|
+ $type = 2;
|
|
foreach ($list as $val) {
|
|
foreach ($list as $val) {
|
|
- $end = $val + $start;
|
|
|
|
|
|
+ $end = $val + $start;
|
|
if($rand > $start && $rand <= $end){
|
|
if($rand > $start && $rand <= $end){
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
$type += 1;
|
|
$type += 1;
|
|
$start = $end;
|
|
$start = $end;
|
|
- }
|
|
|
|
|
|
+ }
|
|
return $type;
|
|
return $type;
|
|
}
|
|
}
|
|
|
|
|