|
@@ -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;
|
|
@@ -87,6 +87,7 @@ class ActiveProc {
|
|
$list = array();
|
|
$list = array();
|
|
if(Enum_Active::NewWish == $type){
|
|
if(Enum_Active::NewWish == $type){
|
|
my_Assert($shenmiaoInfo->activeDic->$type->num < glc()->UserWishNumLimit, ErrCode::active_NewUserActiveNumLimit);
|
|
my_Assert($shenmiaoInfo->activeDic->$type->num < glc()->UserWishNumLimit, ErrCode::active_NewUserActiveNumLimit);
|
|
|
|
+ my_Assert($num == 10, ErrCode::active_NewUserActiveNumLimit);
|
|
|
|
|
|
$shenmiaoInfo->activeDic->$type->num += $num;
|
|
$shenmiaoInfo->activeDic->$type->num += $num;
|
|
$shenmiaoInfo->activeDic->$type->totalNum += $num;
|
|
$shenmiaoInfo->activeDic->$type->totalNum += $num;
|
|
@@ -107,8 +108,8 @@ class ActiveProc {
|
|
if($itemType >= 2){
|
|
if($itemType >= 2){
|
|
$tag = true;
|
|
$tag = true;
|
|
}
|
|
}
|
|
- if($n==10 && $tag == false){
|
|
|
|
- $list[] =self::getActiveRandomItem(Enum_ActiveItemType::Ssr, $shenmo);
|
|
|
|
|
|
+ if($n==10 && $tag == false){
|
|
|
|
+ $list[] =self::getActiveRandomItem(self::randSsrUr($shenmo->per), $shenmo);
|
|
} else {
|
|
} else {
|
|
$nId =self::getActiveRandomItem($itemType, $shenmo);
|
|
$nId =self::getActiveRandomItem($itemType, $shenmo);
|
|
$list[] = $nId;
|
|
$list[] = $nId;
|
|
@@ -151,7 +152,7 @@ class ActiveProc {
|
|
$tag = true;
|
|
$tag = true;
|
|
}
|
|
}
|
|
if($n==10 && $tag == false){
|
|
if($n==10 && $tag == false){
|
|
- $list[] =self::getActiveRandomItem(Enum_ActiveItemType::Ssr, $shenmo);
|
|
|
|
|
|
+ $list[] =self::getActiveRandomItem(self::randSsrUr($shenmo->per), $shenmo);
|
|
} else {
|
|
} else {
|
|
$list[] =self::getActiveRandomItem($itemType, $shenmo);
|
|
$list[] =self::getActiveRandomItem($itemType, $shenmo);
|
|
}
|
|
}
|
|
@@ -192,7 +193,7 @@ class ActiveProc {
|
|
$tag = true;
|
|
$tag = true;
|
|
}
|
|
}
|
|
if($n==10 && $tag == false){
|
|
if($n==10 && $tag == false){
|
|
- $list[] =self::getActiveRandomItem_3(Enum_ActiveItemType::Ssr, $shenmo);
|
|
|
|
|
|
+ $list[] =self::getActiveRandomItem_3(self::randSsrUr($shenmo->per), $shenmo);
|
|
} else {
|
|
} else {
|
|
$list[] =self::getActiveRandomItem_3($itemType, $shenmo);
|
|
$list[] =self::getActiveRandomItem_3($itemType, $shenmo);
|
|
}
|
|
}
|
|
@@ -390,25 +391,23 @@ class ActiveProc {
|
|
* 从SSr 和 uR中得一个
|
|
* 从SSr 和 uR中得一个
|
|
* @param type $param
|
|
* @param type $param
|
|
*/
|
|
*/
|
|
- public function functionName($per) {
|
|
|
|
|
|
+ public static function randSsrUr($randCtx) {
|
|
$list = explode(',', $randCtx);
|
|
$list = explode(',', $randCtx);
|
|
- $n = 0;
|
|
|
|
- foreach ($list as $value) {
|
|
|
|
- if($n == 0){
|
|
|
|
- contains($value);
|
|
|
|
- }
|
|
|
|
- $n+= 1;
|
|
|
|
- }
|
|
|
|
|
|
+ $list = array_splice($list,1);
|
|
|
|
+ $total = $list[0]+$list[1];
|
|
|
|
+
|
|
|
|
+ $rand = rand(1,$total);
|
|
$start = 0;
|
|
$start = 0;
|
|
|
|
+ $type = Enum_ActiveItemType::Ssr;
|
|
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;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|