From 03c4fc6e1ecd16a101009f6a709848daa533b2be Mon Sep 17 00:00:00 2001 From: jiahuiwen <1024696487@qq.com> Date: Mon, 20 May 2019 16:18:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=8C=E4=B8=BA=E7=B1=BB=E5=9E=8B=2036=20?= =?UTF-8?q?=E6=8E=A8=E4=BB=BB=E5=8A=A1=EF=BC=8C=E6=B6=88=E8=80=97=E9=81=93?= =?UTF-8?q?=E5=85=B7=EF=BC=8C=E5=88=A0=E9=99=A4=E6=8C=87=E5=AE=9A=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ljsd/jieling/handler/map/EventType.java | 1 + .../map/behavior/ThirtySexBehavior.java | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/ThirtySexBehavior.java diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/EventType.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/EventType.java index 8f1e6372d..8343f0d03 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/EventType.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/EventType.java @@ -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; diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/ThirtySexBehavior.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/ThirtySexBehavior.java new file mode 100644 index 000000000..9358a81b5 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/ThirtySexBehavior.java @@ -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; + } +}