新增惩罚礼物
This commit is contained in:
@@ -275,11 +275,18 @@ public class PKBoardView extends RelativeLayout implements View.OnClickListener
|
||||
|
||||
if (redTeamInfo != null && blueTeamInfo != null) {
|
||||
long totalScore = redTeamInfo.getScore() + blueTeamInfo.getScore();
|
||||
if (totalScore > 0) {
|
||||
if (redTeamInfo.getScore() > 0 && blueTeamInfo.getScore() > 0) {
|
||||
int percent = (int) ((float) redTeamInfo.getScore() / (float) totalScore * 100.0f);
|
||||
pbScore.setProgress(percent);
|
||||
} else {
|
||||
} else if (redTeamInfo.getScore() == 0 && blueTeamInfo.getScore() == 0) {
|
||||
pbScore.setProgress(50);
|
||||
} else if (redTeamInfo.getScore() < 0 && blueTeamInfo.getScore() < 0) {
|
||||
int percent = (int) ((float) blueTeamInfo.getScore() / (float) totalScore * 100.0f);
|
||||
pbScore.setProgress(percent);
|
||||
} else if (redTeamInfo.getScore() > 0) {
|
||||
pbScore.setProgress(100);
|
||||
} else {
|
||||
pbScore.setProgress(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -38,6 +38,7 @@ import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.github.mmin18.widget.RealtimeBlurView;
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||
import com.mango.core.DemoCache;
|
||||
import com.mango.core.UriProvider;
|
||||
import com.mango.core.auth.AuthModel;
|
||||
import com.mango.core.bean.RoomQueueInfo;
|
||||
@@ -200,6 +201,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
private TextView tvTabInteraction;
|
||||
private View llTabType;
|
||||
private View lineTabType;
|
||||
private View viewNewFeature;
|
||||
private RollPagerView pagerViewVip;
|
||||
private boolean isShowDrawGiftModel;
|
||||
@Nullable
|
||||
@@ -423,6 +425,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_WEEK, "周星", "周星"));
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_SING_ROOM, "人气", "人气"));
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_DRAW_GIFT, "涂鸦礼物", "涂鸦礼物"));
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_PENALTY, "惩罚礼物", "惩罚礼物"));
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_KNAP, "背包", "背包"));
|
||||
giftIndicator = findViewById(R.id.gift_indicator);
|
||||
giftIndicator.initTab(
|
||||
@@ -542,6 +545,10 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
|
||||
compositeDisposable.add(GiftModel.get().requestKnapGiftInfos().subscribe());
|
||||
initVipPager();
|
||||
viewNewFeature = findViewById(R.id.view_new_feature);
|
||||
if (DemoCache.readNewGiftTypeTipIndicator()) {
|
||||
viewNewFeature.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
private void initVipPager() {
|
||||
@@ -619,7 +626,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
String goldNumText = getContext().getString(R.string.gold_num_text, goldWalletInfo.getDiamondNum());
|
||||
SpannableBuilder builder = new SpannableBuilder();
|
||||
builder.append(context.getText(R.string.gift_wallet_overage), new ForegroundColorSpan(
|
||||
context.getResources().getColor(R.color.white_transparent_50)))
|
||||
context.getResources().getColor(R.color.white_transparent_50)))
|
||||
.append(goldNumText);
|
||||
tvTextGold.setText(builder.build());
|
||||
}
|
||||
@@ -651,6 +658,8 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
currentGiftInfoList = getDrawGiftInfos();
|
||||
} else if (position == GiftIndicator.TYPE_SING_ROOM) {
|
||||
currentGiftInfoList = getSingleRoomGiftInfos();
|
||||
} else if (position == GiftIndicator.TYPE_PENALTY) {
|
||||
currentGiftInfoList = getPenaltyGiftInfos();
|
||||
}
|
||||
//是否背包礼物
|
||||
final boolean isKnap = (position == GiftIndicator.TYPE_KNAP);
|
||||
@@ -663,7 +672,8 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
} else if (position == GiftIndicator.TYPE_LUCKY ||
|
||||
position == GiftIndicator.TYPE_WEEK ||
|
||||
position == GiftIndicator.TYPE_DRAW_GIFT ||
|
||||
position == GiftIndicator.TYPE_SING_ROOM) {
|
||||
position == GiftIndicator.TYPE_SING_ROOM ||
|
||||
position == GiftIndicator.TYPE_PENALTY) {
|
||||
showEmptyView();
|
||||
updateWeekStarDesc();
|
||||
isShowDrawGiftModel = false;
|
||||
@@ -1074,6 +1084,12 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
GiftType.GIFT_TYPE_SINGLE_ROOM);
|
||||
}
|
||||
|
||||
private List<GiftInfo> getPenaltyGiftInfos() {
|
||||
return GiftModel.get().getGiftInfosByType(
|
||||
String.valueOf(AvRoomDataManager.get().getRoomUid()),
|
||||
GiftType.GIFT_TYPE_PENALTY);
|
||||
}
|
||||
|
||||
private List<GiftInfo> getNobleGiftInfos() {
|
||||
return GiftModel.get().getGiftInfoList(GiftType.GIFT_TYPE_VIP);
|
||||
}
|
||||
@@ -1329,6 +1345,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
tvTabInteraction.setSelected(false);
|
||||
tvTabInteraction.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
||||
giftIndicator.hidePosition(GiftIndicator.TYPE_DRAW_GIFT);
|
||||
giftIndicator.hidePosition(GiftIndicator.TYPE_PENALTY);
|
||||
giftIndicator.showPosition(GiftIndicator.TYPE_LUCKY);
|
||||
giftIndicator.showPosition(GiftIndicator.TYPE_NOBLE);
|
||||
giftIndicator.showPosition(GiftIndicator.TYPE_WEEK);
|
||||
@@ -1345,12 +1362,17 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
|
||||
private void showInteractionTab() {
|
||||
if (tvTabInteraction.isSelected()) return;
|
||||
if (viewNewFeature.getVisibility() == View.VISIBLE) {
|
||||
viewNewFeature.setVisibility(View.GONE);
|
||||
DemoCache.saveNewGiftTypeTipIndicator(false);
|
||||
}
|
||||
tvTabSendGift.setSelected(false);
|
||||
tvTabSendGift.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
||||
tvTabInteraction.setSelected(true);
|
||||
tvTabInteraction.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, R.drawable.ic_gift_dialog_top_indicator);
|
||||
|
||||
giftIndicator.showPosition(GiftIndicator.TYPE_DRAW_GIFT);
|
||||
giftIndicator.showPosition(GiftIndicator.TYPE_PENALTY);
|
||||
giftIndicator.hidePosition(GiftIndicator.TYPE_LUCKY);
|
||||
giftIndicator.hidePosition(GiftIndicator.TYPE_NOBLE);
|
||||
giftIndicator.hidePosition(GiftIndicator.TYPE_WEEK);
|
||||
|
@@ -7,9 +7,11 @@ import androidx.annotation.Nullable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mango.core.DemoCache;
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.mango.core.gift.bean.GiftTab;
|
||||
@@ -66,6 +68,11 @@ public class GiftIndicator extends LinearLayout {
|
||||
*/
|
||||
public static final int TYPE_SING_ROOM = 6;
|
||||
|
||||
/**
|
||||
* 惩罚礼物
|
||||
*/
|
||||
public static final int TYPE_PENALTY = 7;
|
||||
|
||||
private Map<String, String> map = new HashMap<>();
|
||||
private List<GiftTab> tabList = new ArrayList<>();
|
||||
@Getter
|
||||
@@ -104,6 +111,13 @@ public class GiftIndicator extends LinearLayout {
|
||||
index.getItemView().setOnClickListener(v -> {
|
||||
setPosition(index.getType());
|
||||
emitter.onNext(index.getType());
|
||||
if (index.getType() == TYPE_PENALTY) {
|
||||
ImageView imageView = index.getItemView().findViewById(R.id.iv_new_tag);
|
||||
if (imageView.getVisibility() == VISIBLE) {
|
||||
imageView.setVisibility(GONE);
|
||||
DemoCache.saveNewGiftTypeTip(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -138,6 +152,12 @@ public class GiftIndicator extends LinearLayout {
|
||||
for (GiftTab tab : tabList) {
|
||||
if (tab.getType() == type) {
|
||||
tab.getItemView().setVisibility(VISIBLE);
|
||||
if (type == TYPE_PENALTY) {
|
||||
if (DemoCache.readNewGiftTypeTip()) {
|
||||
ImageView imageView = tab.getItemView().findViewById(R.id.iv_new_tag);
|
||||
imageView.setVisibility(VISIBLE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
BIN
app/src/main/res/drawable-xhdpi/ic_gift_dialog_new.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_gift_dialog_new.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
@@ -15,10 +15,10 @@
|
||||
android:layout_marginBottom="12dp"
|
||||
android:background="@drawable/bg_gift_dialog_lucky_desc"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
app:layout_constraintBottom_toTopOf="@id/ll_dialog_bottom_gift"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -29,12 +29,12 @@
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_lucky_msg"
|
||||
android:layout_marginStart="30dp"
|
||||
tools:listitem="@layout/item_lucky_gift_msg"
|
||||
tools:itemCount="1"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="30dp"
|
||||
tools:itemCount="1"
|
||||
tools:listitem="@layout/item_lucky_gift_msg" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_lucky_bag_intro"
|
||||
@@ -303,6 +303,14 @@
|
||||
android:textColor="@color/color_selector_white_false_8a8cab"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_new_feature"
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="8dp"
|
||||
android:layout_marginStart="-4dp"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/shap_red_point" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
|
@@ -3,8 +3,8 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="26dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="@dimen/dp_7"
|
||||
android:paddingRight="@dimen/dp_7">
|
||||
|
||||
@@ -13,8 +13,16 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
tools:text="全部礼物"
|
||||
android:textSize="@dimen/dp_13"
|
||||
tools:ignore="SpUsage" />
|
||||
tools:ignore="SpUsage"
|
||||
tools:text="全部礼物" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_new_tag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top"
|
||||
android:src="@drawable/ic_gift_dialog_new"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
@@ -62,6 +62,8 @@ public class DemoCache {
|
||||
private static final String KEY_PM_MODE = "key_pm_mode";
|
||||
private static final String KEY_SHOW_BOX_TIP = "key_show_box_tip";
|
||||
private static final String KEY_SHOW_RADISH_TIP = "key_show_radish_tip";
|
||||
private static final String KEY_NEW_GIFT_TYPE_TIP = "key_new_gift_type_tip";
|
||||
private static final String KEY_NEW_GIFT_TYPE_TIP_INDICATOR = "key_new_gift_type_tip_indicator";
|
||||
|
||||
private static StatusBarNotificationConfig notificationConfig;
|
||||
|
||||
@@ -367,4 +369,20 @@ public class DemoCache {
|
||||
return SettingsPref.instance().getBoolean(KEY_SHOW_RADISH_TIP + AuthModel.get().getCurrentUid(), true);
|
||||
}
|
||||
|
||||
public static void saveNewGiftTypeTip(boolean value) {
|
||||
SettingsPref.instance().putBoolean(KEY_NEW_GIFT_TYPE_TIP, value);
|
||||
}
|
||||
|
||||
public static boolean readNewGiftTypeTip() {
|
||||
return SettingsPref.instance().getBoolean(KEY_NEW_GIFT_TYPE_TIP, true);
|
||||
}
|
||||
|
||||
public static void saveNewGiftTypeTipIndicator(boolean value) {
|
||||
SettingsPref.instance().putBoolean(KEY_NEW_GIFT_TYPE_TIP_INDICATOR, value);
|
||||
}
|
||||
|
||||
public static boolean readNewGiftTypeTipIndicator() {
|
||||
return SettingsPref.instance().getBoolean(KEY_NEW_GIFT_TYPE_TIP_INDICATOR, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -200,6 +200,9 @@ public class GiftModel extends BaseModel implements IGiftModel {
|
||||
case GiftType.GIFT_TYPE_SINGLE_ROOM:
|
||||
giftInfos = allGiftListInfo.getSinglePopularGift();
|
||||
break;
|
||||
case GiftType.GIFT_TYPE_PENALTY:
|
||||
giftInfos = allGiftListInfo.getPenaltyGift();
|
||||
break;
|
||||
}
|
||||
return giftInfos == null ? new ArrayList<>() : giftInfos;
|
||||
}
|
||||
@@ -577,6 +580,9 @@ public class GiftModel extends BaseModel implements IGiftModel {
|
||||
if (giftInfo == null) {
|
||||
giftInfo = findGiftInfoById(allGiftListInfo.getSinglePopularGift(), giftId);
|
||||
}
|
||||
if (giftInfo == null) {
|
||||
giftInfo = findGiftInfoById(allGiftListInfo.getPenaltyGift(), giftId);
|
||||
}
|
||||
}
|
||||
return giftInfo;
|
||||
}
|
||||
|
@@ -18,6 +18,7 @@ public class GiftListInfo implements Serializable {
|
||||
private List<GiftInfo> weekStarGift;
|
||||
private List<GiftInfo> drawGift;
|
||||
private List<GiftInfo> singlePopularGift;
|
||||
private List<GiftInfo> penaltyGift;
|
||||
private String giftVersion;
|
||||
|
||||
}
|
||||
|
@@ -40,4 +40,6 @@ public class GiftType {
|
||||
public static final int GIFT_TYPE_DRAW_GIFT = 10;
|
||||
|
||||
public static final int GIFT_TYPE_SINGLE_ROOM = 11;
|
||||
|
||||
public static final int GIFT_TYPE_PENALTY = 12;
|
||||
}
|
||||
|
@@ -51,6 +51,8 @@ public class GiftValueMrg {
|
||||
*/
|
||||
private long reConnectTimeFlag = 0;
|
||||
|
||||
private final long valueIfKeyNotFound = Long.MIN_VALUE;
|
||||
|
||||
public static GiftValueMrg get() {
|
||||
return Helper.INSTANCE;
|
||||
}
|
||||
@@ -177,8 +179,8 @@ public class GiftValueMrg {
|
||||
if (roomQueueInfo.giftValueData == null) {
|
||||
roomQueueInfo.giftValueData = new GiftValueData();
|
||||
}
|
||||
long value = giftValueArray.get(micUid, -1L);
|
||||
if (value >= 0) {
|
||||
long value = giftValueArray.get(micUid, valueIfKeyNotFound);
|
||||
if (value != valueIfKeyNotFound) {
|
||||
roomQueueInfo.giftValueData.updateValue(value);
|
||||
}
|
||||
if (roomQueueInfo.giftValueData.getLdValue().getValue()!=null && roomQueueInfo.giftValueData.getLdValue().getValue() > 0){
|
||||
@@ -189,8 +191,8 @@ public class GiftValueMrg {
|
||||
if (roomQueueInfo.giftValueData == null) {
|
||||
roomQueueInfo.giftValueData = new GiftValueData();
|
||||
}
|
||||
long value = giftValueArray.get(micUid, -1L);
|
||||
if (value >= 0) {
|
||||
long value = giftValueArray.get(micUid, valueIfKeyNotFound);
|
||||
if (value != valueIfKeyNotFound) {
|
||||
roomQueueInfo.giftValueData.updateValue(value);
|
||||
}
|
||||
}
|
||||
@@ -250,8 +252,8 @@ public class GiftValueMrg {
|
||||
if (roomQueueInfo.mChatRoomMember != null) {
|
||||
//排序列表大于一并且麦位account等于最低魅力值account
|
||||
if (arraySortGiftValue.size() > 1 && roomQueueInfo.mChatRoomMember.getAccount().equals(String.valueOf(minUid))){
|
||||
long minValue = arrayAllMicList.get(minUid, -1L);
|
||||
if (minValue > 0){
|
||||
long minValue = arrayAllMicList.get(minUid, valueIfKeyNotFound);
|
||||
if (minValue != valueIfKeyNotFound){
|
||||
giftValueData.updateHeadWear(1);
|
||||
}else {
|
||||
giftValueData.updateHeadWear(0);
|
||||
@@ -298,8 +300,8 @@ public class GiftValueMrg {
|
||||
GiftValueData giftValueData = roomQueueInfo.giftValueData;
|
||||
if (roomQueueInfo.mChatRoomMember != null) {
|
||||
long micUid = JavaUtil.str2long(roomQueueInfo.mChatRoomMember.getAccount());
|
||||
long newValue = array.get(micUid, -1L);
|
||||
if (newValue >= 0){
|
||||
long newValue = array.get(micUid, valueIfKeyNotFound);
|
||||
if (newValue != valueIfKeyNotFound){
|
||||
giftValueData.updateValue(newValue);
|
||||
}
|
||||
if (roomQueueInfo.giftValueData.getLdValue().getValue()!=null && roomQueueInfo.giftValueData.getLdValue().getValue() > 0){
|
||||
@@ -308,8 +310,8 @@ public class GiftValueMrg {
|
||||
} else {
|
||||
if (AvRoomDataManager.get().isLeaveMode() && key == -1) { // 离开模式礼物值变化
|
||||
long micUid = AvRoomDataManager.get().getRoomUid();
|
||||
long newValue = array.get(micUid, -1L);
|
||||
if (newValue >= 0){
|
||||
long newValue = array.get(micUid, valueIfKeyNotFound);
|
||||
if (newValue != valueIfKeyNotFound){
|
||||
giftValueData.updateValue(newValue);
|
||||
}
|
||||
} else{
|
||||
|
@@ -7,6 +7,7 @@ import android.util.SparseArray;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.mango.core.gift.bean.GiftType;
|
||||
import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
import com.orhanobut.logger.Logger;
|
||||
@@ -129,7 +130,7 @@ public class PkModel extends BaseModel implements IPkModel {
|
||||
teamId = getTeamIdInPKMemberList(String.valueOf(giftReceiveInfo.getTargetUid()));
|
||||
if (teamId != 0) {
|
||||
if (curPkInfo.getVoteMode() == PK_VOTE_MODE_GIFT_VALUE) {
|
||||
addTeamScoreByGiftValue(teamId, giftReceiveInfo.getGiftNum() * giftReceiveInfo.getGift().getGoldPrice());
|
||||
addTeamScoreByGiftValue(teamId, giftReceiveInfo.getGiftNum() * giftReceiveInfo.getGift().getGoldPrice() * handlePenalty(giftReceiveInfo.getGift()));
|
||||
} else if (curPkInfo.getVoteMode() == PK_VOTE_MODE_PEOPLE_COUNT) {
|
||||
addTeamScoreByPeopleCount(teamId, giftReceiveInfo.getUid(), giftReceiveInfo.getTargetUid());
|
||||
}
|
||||
@@ -146,7 +147,7 @@ public class PkModel extends BaseModel implements IPkModel {
|
||||
teamId = getTeamIdInPKMemberList(String.valueOf(giftReceiver.getUid()));
|
||||
if (teamId != 0) {
|
||||
if (curPkInfo.getVoteMode() == PK_VOTE_MODE_GIFT_VALUE) {
|
||||
addTeamScoreByGiftValue(teamId, giftMultiReceiverInfo.getGiftNum() * giftMultiReceiverInfo.getGift().getGoldPrice());
|
||||
addTeamScoreByGiftValue(teamId, giftMultiReceiverInfo.getGiftNum() * giftMultiReceiverInfo.getGift().getGoldPrice() * handlePenalty(giftMultiReceiverInfo.getGift()));
|
||||
} else if (curPkInfo.getVoteMode() == PK_VOTE_MODE_PEOPLE_COUNT) {
|
||||
addTeamScoreByPeopleCount(teamId, giftMultiReceiverInfo.getUid(), giftReceiver.getUid());
|
||||
}
|
||||
@@ -164,7 +165,7 @@ public class PkModel extends BaseModel implements IPkModel {
|
||||
teamId = getTeamIdInPKMemberList(String.valueOf(targetUid));
|
||||
if (teamId != 0) {
|
||||
if (curPkInfo.getVoteMode() == PK_VOTE_MODE_GIFT_VALUE) {
|
||||
addTeamScoreByGiftValue(teamId, multiReceiverInfo.getGiftNum() * multiReceiverInfo.getGift().getGoldPrice());
|
||||
addTeamScoreByGiftValue(teamId, multiReceiverInfo.getGiftNum() * multiReceiverInfo.getGift().getGoldPrice() * handlePenalty(multiReceiverInfo.getGift()));
|
||||
} else if (curPkInfo.getVoteMode() == PK_VOTE_MODE_PEOPLE_COUNT) {
|
||||
addTeamScoreByPeopleCount(teamId, multiReceiverInfo.getUid(), targetUid);
|
||||
}
|
||||
@@ -215,7 +216,7 @@ public class PkModel extends BaseModel implements IPkModel {
|
||||
for (GiftList giftList : luckyBagGifts.getGiftList()) {
|
||||
GiftInfo giftInfo = GiftModel.get().findGiftInfoById(giftList.getGiftId());
|
||||
if (giftInfo != null) {
|
||||
totalPrice += giftList.getGiftNum() * giftInfo.getGoldPrice();
|
||||
totalPrice += giftList.getGiftNum() * giftInfo.getGoldPrice() * handlePenalty(giftInfo);
|
||||
}
|
||||
}
|
||||
addTeamScoreByGiftValue(teamId, totalPrice);
|
||||
@@ -238,6 +239,10 @@ public class PkModel extends BaseModel implements IPkModel {
|
||||
return giftInfo != null && giftInfo.getConsumeType() == GiftInfo.CONSUME_TYPE_GOLD;
|
||||
}
|
||||
|
||||
private int handlePenalty(GiftInfo giftInfo) {
|
||||
return giftInfo.getGiftType() == GiftType.GIFT_TYPE_PENALTY ? -1 : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据人数统计
|
||||
*
|
||||
|
Reference in New Issue
Block a user