行为类型 36 推任务,消耗道具,删除指定地图点
parent
b36f434768
commit
03c4fc6e1e
|
@ -93,6 +93,7 @@ public class EventType {
|
||||||
public static final int thirtyThree = 33;
|
public static final int thirtyThree = 33;
|
||||||
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 updatePonintEvent = 1;
|
public static final int updatePonintEvent = 1;
|
||||||
public static final int fightEvent = 2;
|
public static final int fightEvent = 2;
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue