区分战斗行为
parent
6992512d3b
commit
519679a116
|
@ -469,11 +469,10 @@ public class MapLogic {
|
|||
}
|
||||
int nextEventId = 0;
|
||||
// 战斗事件需要放到战斗胜利
|
||||
if (behaviorType != EventType.fight && behaviorType != EventType.fightAndDestroyPoint
|
||||
&& behaviorType != EventType.thirtyTwo && behaviorType != EventType.destroyPointAnd) {
|
||||
if (baseBehavior == null || !baseBehavior.isFightBehavior()) {
|
||||
// 检测该事件点是否已被销毁
|
||||
nextEventId = getNextEventId(user, cell, sOptionConfig);
|
||||
if (cell != null && nextEventId != 0) {
|
||||
nextEventId = getNextEventId(user, cell, sOptionConfig);
|
||||
cell.setEventId(nextEventId);
|
||||
mapManager.addOrUpdateCell(cell.getCellId(), cell);
|
||||
}
|
||||
|
|
|
@ -16,4 +16,8 @@ public abstract class BaseBehavior {
|
|||
public boolean afterFight(User user, int[][] behaviorTypeValues, FightInfoProto.FightEndResponse.Builder fightEndResponse) throws Exception {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isFightBehavior() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,8 +15,8 @@ public class DestroyPointAndBehavior extends BaseBehavior {
|
|||
|
||||
@Override
|
||||
public boolean process(int optionId, User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception {
|
||||
// readyInfo: optionId
|
||||
String readyInfo = Integer.toString(optionId);
|
||||
// readyInfo: groupId#optionId
|
||||
String readyInfo = behaviorTypeValues[0][0] + "#" + Integer.toString(optionId);
|
||||
BehaviorUtil.fightReady(user.getId(), readyInfo);
|
||||
return true;
|
||||
}
|
||||
|
@ -26,4 +26,9 @@ public class DestroyPointAndBehavior extends BaseBehavior {
|
|||
BehaviorUtil.destoryPoint(user, user.getMapManager().getCurMapId(), behaviorTypeValues[0][1]);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFightBehavior() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ public class FightAndDestroyPointBehavior extends BaseBehavior {
|
|||
@Override
|
||||
public boolean process(int optionId, User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception {
|
||||
// optionId
|
||||
String readyInfo = Integer.toString(optionId);
|
||||
String readyInfo = behaviorTypeValues[0][1] + "#" + Integer.toString(optionId);
|
||||
BehaviorUtil.fightReady(user.getId(), readyInfo);
|
||||
return true;
|
||||
}
|
||||
|
@ -27,4 +27,9 @@ public class FightAndDestroyPointBehavior extends BaseBehavior {
|
|||
BehaviorUtil.destoryPoint(user, 0, behaviorTypeValues[0][2]);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFightBehavior() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public class FightBehavior extends BaseBehavior {
|
|||
|
||||
@Override
|
||||
public boolean process(int optionId, User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception {
|
||||
BehaviorUtil.fightReady(user.getId(), Integer.toString(optionId));
|
||||
BehaviorUtil.fightReady(user.getId(), behaviorTypeValues[0][0] + "#" + Integer.toString(optionId));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -24,4 +24,9 @@ public class FightBehavior extends BaseBehavior {
|
|||
BehaviorUtil.destoryCurPoint(user);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFightBehavior() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ public class ThirtyThreeBehavior extends BaseBehavior {
|
|||
@Override
|
||||
public boolean process(int optionId, User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception {
|
||||
// readyInfo: 怪物组id#任务id#需要销毁事件id => 怪物组id#optionId
|
||||
String readyInfo = Integer.toString(optionId);
|
||||
String readyInfo = behaviorTypeValues[0][0] + "#" + Integer.toString(optionId);
|
||||
BehaviorUtil.fightReady(user.getId(), readyInfo);
|
||||
return true;
|
||||
}
|
||||
|
@ -27,4 +27,9 @@ public class ThirtyThreeBehavior extends BaseBehavior {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFightBehavior() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ public class ThirtyTwoBehavior extends BaseBehavior {
|
|||
@Override
|
||||
public boolean process(int optionId, User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception {
|
||||
// readyInfo: 怪物组id#任务id#需要销毁事件id => 怪物组id#optionId
|
||||
String readyInfo = Integer.toString(optionId);
|
||||
String readyInfo = behaviorTypeValues[0][0] + "#" + Integer.toString(optionId);
|
||||
BehaviorUtil.fightReady(user.getId(), readyInfo);
|
||||
return true;
|
||||
}
|
||||
|
@ -30,4 +30,9 @@ public class ThirtyTwoBehavior extends BaseBehavior {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFightBehavior() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue