food buffer
parent
33cd931e82
commit
c7ef7294ff
|
@ -91,4 +91,7 @@ public interface BIReason {
|
||||||
|
|
||||||
int CHALLENGE_INVASIONBOSS_CONSUME = 1024;
|
int CHALLENGE_INVASIONBOSS_CONSUME = 1024;
|
||||||
|
|
||||||
|
|
||||||
|
int MAP_CONSUME = 1025;
|
||||||
|
|
||||||
}
|
}
|
|
@ -97,6 +97,7 @@ public class EventType {
|
||||||
public static final int thirtyFour = 34;
|
public static final int thirtyFour = 34;
|
||||||
public static final int thirtyFive = 35;
|
public static final int thirtyFive = 35;
|
||||||
public static final int thirtySix = 36;
|
public static final int thirtySix = 36;
|
||||||
|
public static final int thirtySeven = 37;
|
||||||
|
|
||||||
public static final int thirtyEight = 38;
|
public static final int thirtyEight = 38;
|
||||||
public static final int thirtyNine = 39;
|
public static final int thirtyNine = 39;
|
||||||
|
|
|
@ -179,7 +179,7 @@ public class MapLogic {
|
||||||
MapInfoProto.MapEnterResponse.Builder mapEnterResponse = MapInfoProto.MapEnterResponse.newBuilder();
|
MapInfoProto.MapEnterResponse.Builder mapEnterResponse = MapInfoProto.MapEnterResponse.newBuilder();
|
||||||
mapEnterResponse.setLeftTime(getLeftTime(user, true));
|
mapEnterResponse.setLeftTime(getLeftTime(user, true));
|
||||||
for (Map.Entry<Integer, Integer> buffEntry : mapManager.getFoodBufferMap().entrySet()) {
|
for (Map.Entry<Integer, Integer> buffEntry : mapManager.getFoodBufferMap().entrySet()) {
|
||||||
if (buffEntry.getValue() <= 0) {
|
if (buffEntry.getValue()!=-1 && buffEntry.getValue() <= 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
CommonProto.FoodBuffer foodBuffer = CBean2Proto.getFoodBuffer(buffEntry.getKey(), buffEntry.getValue());
|
CommonProto.FoodBuffer foodBuffer = CBean2Proto.getFoodBuffer(buffEntry.getKey(), buffEntry.getValue());
|
||||||
|
@ -2110,13 +2110,11 @@ public class MapLogic {
|
||||||
|
|
||||||
type = MathUtils.randomFromWeight(bossType);
|
type = MathUtils.randomFromWeight(bossType);
|
||||||
if(mapManager.getTower()<=3){
|
if(mapManager.getTower()<=3){
|
||||||
type = 2;
|
type = 3;
|
||||||
}
|
}
|
||||||
// }else if(mapManager.getTower()==2){
|
// }else if(mapManager.getTower()==2){
|
||||||
// type = 3;
|
// type = 3;
|
||||||
|
|
||||||
|
|
||||||
type = 3;
|
|
||||||
int[][][] pointId = config.getRandomMapPointId();
|
int[][][] pointId = config.getRandomMapPointId();
|
||||||
int mapId = config.getMapId();
|
int mapId = config.getMapId();
|
||||||
SChallengeMapConfig challengeMapConfig = SChallengeMapConfig.integerSChallengeMapConfigMap.get(mapId);
|
SChallengeMapConfig challengeMapConfig = SChallengeMapConfig.integerSChallengeMapConfigMap.get(mapId);
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.ljsd.jieling.handler.map.behavior;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.globals.BIReason;
|
||||||
|
import com.ljsd.jieling.handler.map.EventType;
|
||||||
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
import com.ljsd.jieling.logic.fight.CombatLogic;
|
||||||
|
import com.ljsd.jieling.protocols.MapInfoProto;
|
||||||
|
import com.ljsd.jieling.util.ItemUtil;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class ThirtySevenBehavior extends BaseBehavior{
|
||||||
|
@Override
|
||||||
|
public int getBehaviorType() {
|
||||||
|
return EventType.thirtySeven;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean process(int optionId, User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception {
|
||||||
|
int[][] cost = new int[1][2];
|
||||||
|
cost[0][0] = behaviorTypeValues[0][0];
|
||||||
|
cost[0][1] = behaviorTypeValues[0][1];
|
||||||
|
ItemUtil.itemCost(user,cost, BIReason.MAP_CONSUME,user.getMapManager().getCurMapId());
|
||||||
|
CombatLogic.getInstance().bufferAddByEatFoodOrEventTrigger(user.getMapManager(), behaviorTypeValues[0][2]);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue