玲珑宝阁,十连抽
parent
d627ad64e6
commit
eb3c5d359b
|
@ -154,7 +154,7 @@ public class MathUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
//ab x 公式
|
//ab x 公式
|
||||||
public static float calABX(float source,int[] base){
|
public static float calABX(float source,int[] base){
|
||||||
float result = 0;
|
float result = 0;
|
||||||
int length = base.length;
|
int length = base.length;
|
||||||
for(int i=0;i< base.length;i++){
|
for(int i=0;i< base.length;i++){
|
||||||
|
|
|
@ -1726,7 +1726,7 @@ public class ActivityLogic implements IEventHandler{
|
||||||
*/
|
*/
|
||||||
public ActivityProto.qiMenDunJiaDrawResponse qiMenDunJiaDraw(User user,int activityId,int num) throws Exception {
|
public ActivityProto.qiMenDunJiaDrawResponse qiMenDunJiaDraw(User user,int activityId,int num) throws Exception {
|
||||||
// 道具消耗
|
// 道具消耗
|
||||||
qiMenConsume(user);
|
qiMenConsume(user,num);
|
||||||
// 抽奖逻辑
|
// 抽奖逻辑
|
||||||
ActivityProto.qiMenDunJiaDrawResponse.Builder response = ActivityProto.qiMenDunJiaDrawResponse.newBuilder();
|
ActivityProto.qiMenDunJiaDrawResponse.Builder response = ActivityProto.qiMenDunJiaDrawResponse.newBuilder();
|
||||||
ArrayList<Integer> hits = new ArrayList<>();
|
ArrayList<Integer> hits = new ArrayList<>();
|
||||||
|
@ -1752,11 +1752,11 @@ public class ActivityLogic implements IEventHandler{
|
||||||
* @param user
|
* @param user
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private void qiMenConsume(User user) throws Exception {
|
private void qiMenConsume(User user,int count) throws Exception {
|
||||||
// 获取抽奖消耗配置
|
// 获取抽奖消耗配置
|
||||||
int[][] value = SSpecialConfig.getTwiceArrayValue(SSpecialConfig.LING_LONG_COST);
|
int[][] value = SSpecialConfig.getTwiceArrayValue(SSpecialConfig.LING_LONG_COST);
|
||||||
// 计算数量
|
// 计算数量
|
||||||
int num = (int)MathUtils.calABX(1,value[1]);
|
int num = (int)MathUtils.calABX(count,value[1]);
|
||||||
// 拼装
|
// 拼装
|
||||||
int[][] cost = {{value[0][0], num}};
|
int[][] cost = {{value[0][0], num}};
|
||||||
// 消耗验证
|
// 消耗验证
|
||||||
|
|
Loading…
Reference in New Issue