|
@@ -93,14 +93,8 @@ class ActiveProc {
|
|
|
$shenmiaoInfo->activeDic->$type->totalNum += $num;
|
|
|
|
|
|
$shenmo = GameConfig::shenmiao_getItem($shenmiaoInfo->activeDic->$type->id);
|
|
|
-
|
|
|
- $sList = explode(',', $shenmo->cost);
|
|
|
- $costVal = $sList[1];
|
|
|
- if($shenmo->discount != 0){
|
|
|
- $costVal = $sList[1]*$num*$shenmo->discount/100;
|
|
|
- }
|
|
|
- StoreProc::removeItemFromStore($req->userInfo->game->store,$sList[0],$costVal);
|
|
|
-
|
|
|
+ self::cost($req, $shenmo,$num);
|
|
|
+
|
|
|
$tag = false;
|
|
|
$n = 0;
|
|
|
for ($index = 0; $index < $num; $index++) {
|
|
@@ -131,83 +125,23 @@ class ActiveProc {
|
|
|
$shenmo = GameConfig::shenmiao_getItem($shenmiaoInfo->activeDic->$type->id);
|
|
|
if($num == 1){
|
|
|
$shenmiaoInfo->activeDic->$type->num += $num;
|
|
|
- $sList = explode(',', $shenmo->cost);
|
|
|
- StoreProc::removeItemFromStore($req->userInfo->game->store,$sList[0],$sList[1]);
|
|
|
-
|
|
|
- $itemType = self::activeRandom($shenmo->per, $shenmo);
|
|
|
- $aid =self::getActiveRandomItem($itemType, $shenmo);
|
|
|
-
|
|
|
- if($shenmiaoInfo->activeDic->$type->num % glc()->Active_UR_Num == 0 && $itemType != Enum_ActiveItemType::Ur){
|
|
|
- $aid =self::getActiveRandomItem(Enum_ActiveItemType::Ur, $shenmo);
|
|
|
- $list[] = $aid;
|
|
|
- } else {
|
|
|
- $list[] = $aid;
|
|
|
- }
|
|
|
+ self::cost($req, $shenmo);
|
|
|
+ $list[] = self::drawOneLottery($shenmo, $type);
|
|
|
} else {//10连抽
|
|
|
- $sList = explode(',', $shenmo->cost);
|
|
|
- StoreProc::removeItemFromStore($req->userInfo->game->store,$sList[0],$sList[1]*$num);
|
|
|
-
|
|
|
- $shenmiaoInfo->activeDic->$type->totalNum += $num;
|
|
|
- $tag = false;
|
|
|
- $n = 0;
|
|
|
- for ($index1 = 0; $index1 < $num; $index1++) {
|
|
|
- $n+=1;
|
|
|
- $itemType = self::activeRandom($shenmo->per, $shenmo);
|
|
|
- if($itemType >= 2){
|
|
|
- $tag = true;
|
|
|
- }
|
|
|
- if($n==10 && $tag == false){
|
|
|
- $list[] =self::getActiveRandomItem(Enum_ActiveItemType::Ssr, $shenmo);//self::randSsrUr($shenmo->per)
|
|
|
- } else {
|
|
|
- $list[] =self::getActiveRandomItem($itemType, $shenmo);
|
|
|
- }
|
|
|
- }
|
|
|
- if($shenmiaoInfo->activeDic->$type->totalNum >= glc()->Active_UR_Num){//第90次必得
|
|
|
- $aid =self::getActiveRandomItem(Enum_ActiveItemType::Ur, $shenmo);
|
|
|
- $list[0] = $aid;
|
|
|
- $shenmiaoInfo->activeDic->$type->totalNum = 0;
|
|
|
- }
|
|
|
+ self::cost($req, $shenmo,$num);
|
|
|
+ $shenmiaoInfo->activeDic->$type->totalNum += $num;
|
|
|
+ $list = self::drawTenLottery($shenmo, $type, $num);
|
|
|
}
|
|
|
} else {//不定期活动
|
|
|
$shenmo = GameConfig::shenmiao_getItem($shenmiaoInfo->activeDic->$type->id);
|
|
|
if($num == 1){
|
|
|
- $shenmiaoInfo->activeDic->$type->num += $num;
|
|
|
- $sList = explode(',', $shenmo->cost);
|
|
|
- StoreProc::removeItemFromStore($req->userInfo->game->store,$sList[0],$sList[1]);
|
|
|
-
|
|
|
- $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;
|
|
|
-
|
|
|
+ self::cost($req, $shenmo,$num);
|
|
|
+ $shenmiaoInfo->activeDic->$type->num += $num;
|
|
|
+ $list[] = self::drawOneLottery($shenmo, $type);
|
|
|
} else {
|
|
|
- $sList = explode(',', $shenmo->cost);
|
|
|
- StoreProc::removeItemFromStore($req->userInfo->game->store,$sList[0],$sList[1]*$num);
|
|
|
-
|
|
|
- $shenmiaoInfo->activeDic->$type->totalNum += $num;
|
|
|
-
|
|
|
- $tag = false;
|
|
|
- $n = 0;
|
|
|
- for ($index1 = 0; $index1 < $num; $index1++) {
|
|
|
- $n+=1;
|
|
|
- $itemType = self::activeRandom($shenmo->per, $shenmo);
|
|
|
- if($itemType >= 2){
|
|
|
- $tag = true;
|
|
|
- }
|
|
|
- if($n==10 && $tag == false){
|
|
|
- $list[] =self::getActiveRandomItem_3(Enum_ActiveItemType::Ssr, $shenmo,$type);//self::randSsrUr($shenmo->per)
|
|
|
- } else {
|
|
|
- $list[] =self::getActiveRandomItem_3($itemType, $shenmo,$type);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if($shenmiaoInfo->activeDic->$type->totalNum >= glc()->Active_UR_Num){//第90次必得
|
|
|
- $aid =self::getActiveRandomItem_3(Enum_ActiveItemType::Ur, $shenmo,$type);
|
|
|
- $list[0] = $aid;
|
|
|
- $shenmiaoInfo->activeDic->$type->totalNum = 0;
|
|
|
- }
|
|
|
+ self::cost($req, $shenmo,$num);
|
|
|
+ $shenmiaoInfo->activeDic->$type->totalNum += $num;
|
|
|
+ $list = self::drawTenLottery($shenmo, $type, $num);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -224,7 +158,93 @@ class ActiveProc {
|
|
|
'list'=>$list,
|
|
|
'store'=>$req->userInfo->game->store,
|
|
|
));
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 1连抽
|
|
|
+ * @param type $shenmo
|
|
|
+ * @param type $type
|
|
|
+ * @param type $num
|
|
|
+ * @return type
|
|
|
+ */
|
|
|
+ public static function drawOneLottery($shenmo,$type){
|
|
|
+ $req = req();
|
|
|
+ $shenmiaoInfo = $req->userInfo->game->shenmiao;
|
|
|
+
|
|
|
+ $itemType = self::activeRandom($shenmo->per, $shenmo);
|
|
|
+ if($type == Enum_Active::OpenWish){
|
|
|
+ $aid =self::getActiveRandomItem($itemType, $shenmo);
|
|
|
+ } else {
|
|
|
+ $aid =self::getActiveRandomItem_3($itemType, $shenmo,$type);//随机出的id
|
|
|
+ }
|
|
|
+
|
|
|
+ if($shenmiaoInfo->activeDic->$type->num % glc()->Active_UR_Num == 0 && $itemType != Enum_ActiveItemType::Ur){
|
|
|
+ if($type == Enum_Active::OpenWish){
|
|
|
+ $aid =self::getActiveRandomItem(Enum_ActiveItemType::Ur, $shenmo);
|
|
|
+ } else {
|
|
|
+ $aid =self::getActiveRandomItem_3(Enum_ActiveItemType::Ur, $shenmo,$type);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return $aid;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 10连抽
|
|
|
+ * @param type $type
|
|
|
+ * @param type $num
|
|
|
+ */
|
|
|
+ public static function drawTenLottery($shenmo,$type,$num){
|
|
|
+ $req = req();
|
|
|
+ $shenmiaoInfo = $req->userInfo->game->shenmiao;
|
|
|
+
|
|
|
+ $tag = false;
|
|
|
+ $n = 0;
|
|
|
+ $list = array();
|
|
|
+ for ($index1 = 0; $index1 < $num; $index1++) {
|
|
|
+ $n+=1;
|
|
|
+ $itemType = self::activeRandom($shenmo->per, $shenmo);
|
|
|
+ if($itemType >= 2){
|
|
|
+ $tag = true;
|
|
|
+ }
|
|
|
+ if($n==10 && $tag == false){
|
|
|
+ if($type == Enum_Active::OpenWish){
|
|
|
+ $list[] =self::getActiveRandomItem(Enum_ActiveItemType::Ssr, $shenmo);//self::randSsrUr($shenmo->per)
|
|
|
+ } else {
|
|
|
+ $list[] =self::getActiveRandomItem_3(Enum_ActiveItemType::Ssr, $shenmo,$type);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if($type == Enum_Active::OpenWish){
|
|
|
+ $list[] =self::getActiveRandomItem($itemType, $shenmo);
|
|
|
+ } else {
|
|
|
+ $list[] =self::getActiveRandomItem_3($itemType, $shenmo,$type);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if($shenmiaoInfo->activeDic->$type->totalNum >= glc()->Active_UR_Num){//第90次必得
|
|
|
+ if($type == Enum_Active::OpenWish){
|
|
|
+ $aid =self::getActiveRandomItem(Enum_ActiveItemType::Ur, $shenmo);
|
|
|
+ } else {
|
|
|
+ $aid =self::getActiveRandomItem_3(Enum_ActiveItemType::Ur, $shenmo,$type);
|
|
|
+ }
|
|
|
+ $list[0] = $aid;
|
|
|
+ $shenmiaoInfo->activeDic->$type->totalNum = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return $list;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 抽奖消耗
|
|
|
+ */
|
|
|
+ public static function cost($req,$shenmo,$num = 1) {
|
|
|
+ $sList = explode(',', $shenmo->cost);
|
|
|
+ $costVal = $sList[1];
|
|
|
+ if($shenmo->discount != 0){
|
|
|
+ $costVal = $sList[1]*$num*$shenmo->discount/100;
|
|
|
+ }
|
|
|
+ StoreProc::removeItemFromStore($req->userInfo->game->store,$sList[0],$costVal);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
*
|
|
|
* @param type $randCtx
|
|
@@ -390,7 +410,7 @@ class ActiveProc {
|
|
|
}
|
|
|
return $id;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 从SSr 和 uR中得一个
|
|
|
* @param type $param
|
|
@@ -415,32 +435,6 @@ class ActiveProc {
|
|
|
return $type;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- *
|
|
|
- * @param type $activeType
|
|
|
- * @param type $num
|
|
|
- * @param type $shenmo
|
|
|
- * @return type
|
|
|
- */
|
|
|
- public function DrawLottery($activeType,$num,$shenmo,$maxNum) {
|
|
|
- $list = array();
|
|
|
- $tag = false;
|
|
|
- $n = 0;
|
|
|
- for ($index = 0; $index < $num; $index++) {
|
|
|
- $n+=1;
|
|
|
- $itemType = self::activeRandom($shenmo->per, $shenmo);
|
|
|
- if($itemType >= 2){
|
|
|
- $tag = true;
|
|
|
- }
|
|
|
- if($n==10 && $tag == false){
|
|
|
- $list[] =self::getActiveRandomItem(Enum_ActiveItemType::Ssr, $mo);
|
|
|
- } else {
|
|
|
- $list[] =self::getActiveRandomItem($itemType, $mo);
|
|
|
- }
|
|
|
- }
|
|
|
- return $list;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* [6515] 领取 赠送体力
|
|
|
*/
|