特权等级奖励

back_recharge
xuexinpeng 2021-05-20 15:41:33 +08:00
parent a0db7928bf
commit 7c7c3e6bb6
9 changed files with 129 additions and 3 deletions

View File

@ -38,7 +38,6 @@ function this.OnBuffAdd(caster,target,buff)
if caster and target and buff then
if caster.camp==0 and buff.type==BuffName.Control then
local type=buff.ctrlType
LogError("ctrltype=="..type)
if ctrlNumList[type] then
ctrlNumList[type]=ctrlNumList[type]+1
else

View File

@ -1,3 +1,5 @@
v1.0.34
1. 战斗去除log
v1.0.33
1. 同步被动逻辑
v1.0.32

View File

@ -331,5 +331,6 @@ public interface BIReason {
int TA_SUI_LING_XIAO = 1094;//踏碎凌霄
int HARD_STAGE_GET = 1095;
int UP_PRACTICE_LEVEL = 1100;//修行升级
int SVIP_LEVEL_REWARD = 1101;//特权升级等级奖励
}

View File

@ -139,7 +139,9 @@ public class StartHardStageRequestHandler extends BaseHandler<PlayerInfoProto.Ha
int hardStageId = SHardStage.getStageIdByChapterAndSection(user.getHardStageManager().getCurChapter(), user.getHardStageManager().getCurNode());
Poster.getPoster().dispatchEvent(new ShanHeSheJiTuStarEvent(iSession.getUid(), 1, hardStageId));
int starSum = HardStageLogic.getHardStageStarsSum(user);
Poster.getPoster().dispatchEvent(new ShanHeSheJiTuStarEvent(iSession.getUid(), 2, starSum));
if(starSum >0){
Poster.getPoster().dispatchEvent(new ShanHeSheJiTuStarEvent(iSession.getUid(), 2, starSum));
}
ItemUtil.drop(user, dropList.stream().mapToInt(Integer::intValue).toArray(), drop, 1, 0, BIReason.HARD_STAGE_GET);
fightStartResponse.setDrop(drop);
Map<Integer, HardStageChapter> chapt = user.getHardStageManager().getChapterMap(user);

View File

@ -0,0 +1,49 @@
package com.ljsd.jieling.handler.vip;
import com.ljsd.jieling.globals.BIReason;
import com.ljsd.jieling.handler.BaseHandler;
import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.util.ItemUtil;
import com.ljsd.jieling.util.MessageUtil;
import config.SVipLevelConfig;
import org.springframework.stereotype.Component;
import rpc.protocols.CommonProto;
import rpc.protocols.MessageTypeProto;
import rpc.protocols.PlayerInfoProto;
@Component
//@Deprecated //vip
public class VipLevelRewardGetHandler extends BaseHandler<PlayerInfoProto.VipLevelStateRewardRequset> {
@Override
public MessageTypeProto.MessageType getMessageCode() {
return MessageTypeProto.MessageType.VIP_LEVEL_STATE_REWARD_REQUEST;
}
public void processWithProto(ISession iSession, PlayerInfoProto.VipLevelStateRewardRequset proto) throws Exception {
int rewardId= proto.getVipLevelId();
SVipLevelConfig sVipLevelConfig = SVipLevelConfig.getsVipLevelConfigMap().get(rewardId);
if(sVipLevelConfig == null){
return;
}
User user = UserManager.getUser(iSession.getUid());
if(!user.getUserMissionManager().getVipMissionIdsType().getVipRewardMap().containsKey(rewardId)){
return;
}
if(user.getUserMissionManager().getVipMissionIdsType().getVipRewardMap().get(rewardId)!=1){
return;
}
user.getUserMissionManager().getVipMissionIdsType().getVipRewardMap().put(rewardId,2);
user.getUserMissionManager().setVipMissionIdsType(user.getUserMissionManager().getVipMissionIdsType());
int[][] reward = sVipLevelConfig.getReward();
CommonProto.Drop.Builder drop = ItemUtil.drop(UserManager.getUser(iSession.getUid()), reward, BIReason.SVIP_LEVEL_REWARD);
PlayerInfoProto.VipLevelStateRewardResponse.Builder fightStartResponse = PlayerInfoProto.VipLevelStateRewardResponse.newBuilder();
fightStartResponse.setDrop(drop);
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.VIP_LEVEL_STATE_REWARD_RESPONSE.getNumber(), fightStartResponse.build(), true);
}
}

View File

@ -0,0 +1,42 @@
package com.ljsd.jieling.handler.vip;
import com.ljsd.jieling.handler.BaseHandler;
import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.util.MessageUtil;
import org.springframework.stereotype.Component;
import rpc.protocols.CommonProto;
import rpc.protocols.MessageTypeProto;
import rpc.protocols.PlayerInfoProto;
import java.util.Map;
@Component
public class VipLevelRewardHandler extends BaseHandler<PlayerInfoProto.VipLevelStateRequset> {
@Override
public MessageTypeProto.MessageType getMessageCode() {
return MessageTypeProto.MessageType.VIP_LEVEL_STATE_REQUEST;
}
public void processWithProto(ISession iSession, PlayerInfoProto.VipLevelStateRequset proto) throws Exception {
User user = UserManager.getUser(iSession.getUid());
PlayerInfoProto.VipLevelStateResponse.Builder response = PlayerInfoProto.VipLevelStateResponse.newBuilder();
Map<Integer,Integer> vipRewardMap = user.getUserMissionManager().getVipMissionIdsType().getVipRewardMap();
for(int i = user.getPlayerInfoManager().getVipLevel();i>=1;i--){
if(!vipRewardMap.containsKey(i) && i!=0){
vipRewardMap.put(i,0);
}
}
user.getUserMissionManager().setVipMissionIdsType(user.getUserMissionManager().getVipMissionIdsType());
vipRewardMap.forEach((key,val)->{
CommonProto.KeyVal.Builder keyVal = CommonProto.KeyVal.newBuilder();
keyVal.setKey(key);
keyVal.setVal(val);
response.addVipState(keyVal);
});
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.VIP_LEVEL_STATE_RESPONSE.getNumber(), response.build(), true);
}
}

View File

@ -1,5 +1,6 @@
package com.ljsd.jieling.logic.mission.main;
import com.google.common.collect.Maps;
import com.ljsd.jieling.logic.dao.CumulationData;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.mission.MissionLoigc;
@ -12,10 +13,12 @@ import config.STaskConfig;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class VipMissionIdsType extends AbstractMissionType{
private Map<Integer,Integer> vipRewardMap = Maps.newHashMap();//vip等级奖励领取情况<key:等级,val:领取情况(0,未领取,1,领取)>
public VipMissionIdsType(){
}
@ -99,5 +102,7 @@ public class VipMissionIdsType extends AbstractMissionType{
}
public Map<Integer, Integer> getVipRewardMap() {
return vipRewardMap;
}
}

View File

@ -1,5 +1,6 @@
package com.ljsd.jieling.logic.player;
import com.google.common.collect.Maps;
import com.ljsd.GameApplication;
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
import com.ljsd.jieling.config.clazzStaticCfg.TaskStaticConfig;
@ -263,6 +264,24 @@ public class PlayerLogic {
int vipLevel = playerInfoManager.getVipLevel();
playerInfoManager.setVipLevel(vipLevel+1);
//特权等级奖励
Map<Integer, Integer>rewardMap = user.getUserMissionManager().getVipMissionIdsType().getVipRewardMap();
if(!rewardMap.containsKey(playerInfoManager.getVipLevel())){
rewardMap.put(playerInfoManager.getVipLevel(),0);
}
if(rewardMap.get(playerInfoManager.getVipLevel())==0){
rewardMap.put(playerInfoManager.getVipLevel(),1);
}
user.getUserMissionManager().setVipMissionIdsType(user.getUserMissionManager().getVipMissionIdsType());
PlayerInfoProto.VipLevelStateResponse.Builder vipLevelStateResponse = PlayerInfoProto.VipLevelStateResponse.newBuilder();
rewardMap.forEach((key,val)->{
CommonProto.KeyVal.Builder keyVal = CommonProto.KeyVal.newBuilder();
keyVal.setKey(key);
keyVal.setVal(val);
vipLevelStateResponse.addVipState(keyVal);
});
user.getUserMissionManager().onGameEvent(user,GameEvent.VIP_LEVLUP,playerInfoManager.getVipLevel());
CombatLogic.getInstance().getNewAdventureReward(user, true,TimeUtils.nowInt());
List<CommonProto.UserMissionInfo> missionList = new ArrayList<>();
@ -276,6 +295,8 @@ public class PlayerLogic {
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(session.getUid()));
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.VIP_LEVELUP_RESPONSE_VALUE,builder.build(),true);
ReportUtil.onReportEvent(user, ReportEventEnum.VIP_LEVEL_UP.getType());
//特权等级奖励
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.VIP_LEVEL_STATE_RESPONSE.getNumber(), vipLevelStateResponse.build(), true);
}

View File

@ -22,6 +22,7 @@ public class SVipLevelConfig implements BaseConfig {
private int moneyLimit;
private int[][] property;
private int[][] reward;
@Override
@ -74,4 +75,8 @@ public class SVipLevelConfig implements BaseConfig {
public int[][] getProperty() {
return property;
}
public int[][] getReward() {
return reward;
}
}