Browse Source

10连必得SSr

cyzhao 4 years ago
parent
commit
de7ec1478b
1 changed files with 16 additions and 16 deletions
  1. 16 16
      Gameserver/Amfphp/process/ActiveProc.php

+ 16 - 16
Gameserver/Amfphp/process/ActiveProc.php

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