Exemple #1
0
 /**
  * 刷新合成列表
  * @param unknown $player_id
  * @param unknown $grab_treasure_info
  */
 public function refresh_prop_compose($player_id)
 {
     $grab_treasure_info = $this->get_cross("GrabTreasure")->get_grab_treasure($player_id);
     $compose_info = $this->get_prop_compose_info($player_id, $grab_treasure_info);
     #下一次刷新价格
     $refresh_max_times_info = Cache_TimesExpendControl::getInstance()->get_max_times_expend_control_info($this->grab_treasure_refresh_pieces_type);
     $grab_treasure_refresh_pieces_times = $this->get_data('PlayerDailyTime')->get_player_used_time($player_id, 'grab_treasure_refresh_pieces_times');
     if ($grab_treasure_refresh_pieces_times + 1 >= $refresh_max_times_info["times"]) {
         $refresh_times_info = $refresh_max_times_info;
         #刷新最大次数
     } else {
         $where = array('type' => $this->grab_treasure_refresh_pieces_type, 'times' => $grab_treasure_refresh_pieces_times + 1);
         $refresh_times_info = Cache_TimesExpendControl::getInstance()->get_times_expend_control_info($where);
     }
     list($next_cost_currency_type, $next_cost_currency_value) = explode("|", $refresh_times_info['cost']);
     $refresh_num_next_buy_price = "{$next_cost_currency_type}:{$next_cost_currency_value}";
     $out = array('refresh_cost' => '', 'compose_info' => $compose_info, 'refresh_next_cost' => $refresh_num_next_buy_price);
     return $out;
 }
Exemple #2
0
 private function get_task_flush_cost_cur_value($flush_count, $player_info)
 {
     # 获取限制类型和限制信息
     $vip_limit_type = Cache_VipLevelLimit::getInstance()->get_limit_info_func_id(10011);
     if ($vip_limit_type['fun_type'] == 1 && !empty($player_info['vip'])) {
         $vip_limit_info = Cache_VipLevelLimit::getInstance()->get_limit_info($player_info['vip'], 10011);
     } elseif ($vip_limit_type['fun_type'] == 2 && !empty($player_info['privilege_level'])) {
         $left_time = $this->get_game('VipSpecial')->get_left_time($player_info['player_id']);
         if ($left_time > 0) {
             $vip_limit_info = Cache_VipLevelLimit::getInstance()->get_limit_info($player_info['privilege_level'], 10011);
         }
     }
     if (!empty($vip_limit_info)) {
         if ($vip_limit_info['max_times'] > $flush_count) {
             $task_flush_cost_cur_value = 0;
             return array($this->task_flush_cost_cur_type_1, $task_flush_cost_cur_value);
         } else {
             $flush_count -= $vip_limit_info['max_times'];
             # 扣除vip特权免费的次数之后再计算价格
         }
     }
     $flush_cost_info = Cache_TimesExpendControl::getInstance()->get_cost_info($this->daily_task_flush_type, $flush_count + 1);
     list($task_flush_cost_cur_type, $task_flush_cost_cur_value) = explode("|", $flush_cost_info['cost']);
     /**
     		# 刷新次数修正
     		if ($flush_count > $this->task_flush_boundary_num) $flush_count = $this->task_flush_boundary_num; 
     
     		if ($flush_count <= $this->task_flush_revise_num) { # 使用第一种货币刷新
     			$task_flush_cost_cur_type  = $this->task_flush_cost_cur_type_1;
     			$task_flush_cost_cur_value = intval($flush_count) * 2500 + 5000;
     		} else { # 使用第二种货币刷新
     			$task_flush_cost_cur_type  = $this->task_flush_cost_cur_type_2;
     			$task_flush_cost_cur_value = 5 + (intval($flush_count) - 11) * 2;
     		}
     		**/
     return array($task_flush_cost_cur_type, $task_flush_cost_cur_value);
 }