行为类型 36 推任务,消耗道具,删除指定地图点

back_recharge
jiahuiwen 2019-05-20 16:18:41 +08:00
parent b36f434768
commit 03c4fc6e1e
2 changed files with 28 additions and 0 deletions

View File

@ -93,6 +93,7 @@ public class EventType {
public static final int thirtyThree = 33;
public static final int thirtyFour = 34;
public static final int thirtyFive = 35;
public static final int thirtySix = 36;
public static final int updatePonintEvent = 1;
public static final int fightEvent = 2;

View File

@ -0,0 +1,27 @@
package com.ljsd.jieling.handler.map.behavior;
import com.ljsd.jieling.handler.map.EventType;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.protocols.MapInfoProto;
import com.ljsd.jieling.util.ItemUtil;
import java.util.Arrays;
public class ThirtySexBehavior extends BaseBehavior{
@Override
public int getBehaviorType() {
return EventType.thirtySix;
}
@Override
public boolean process(int optionId, User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception {
int[][] ints = Arrays.copyOfRange(behaviorTypeValues, 1, behaviorTypeValues.length);
boolean isEnough = ItemUtil.itemCost(user, ints);
if (!isEnough) {
return isEnough;
}
BehaviorUtil.updateMission(user, eventUpdateResponse);
BehaviorUtil.destoryPoint(user, 0, behaviorTypeValues[0][0]);
return true;
}
}