Class MapleCoconut
java.lang.Object
server.events.MapleEvent
server.events.MapleCoconut
椰子大戰(Coconut Event)小遊戲的事件邏輯,繼承自
MapleEvent。
本類別負責管理楓葉隊(Team Maple)與故事隊(Team Story)的雙隊對抗:
- 維護 506 顆
MapleCoconut.MapleCoconuts椰子物件,各自追蹤命中次數、可否被擊中與停止狀態。 - 以
coconutscore[0]/[1]記錄雙隊得分,並在進入地圖時透過CField.coconutScore(int[])同步給玩家。 startEvent()啟動 300 秒主計時;平局時觸發bonusTime()額外 60 秒決勝; 結束後呼叫warpOut()給予獲勝方獎勵並傳送回原地圖。
巢狀靜態類別 MapleCoconuts 代表單顆椰子的狀態機(命中次數、可打標記、停止標記、上次命中時間)。
本事件由 handling.channel.ChannelServer 持有,透過 MapleEvent.setEvent 排程啟動。
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class MapleEvent
channel, isRunning, playerCount, type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidvoidvoidfinished(MapleCharacter chr) intgetCoconut(int id) int[]intintintintvoidonMapLoad(MapleCharacter chr) voidreset()voidvoidsetHittable(boolean hittable) voidvoidvoidunreset()voidwarpOut()Methods inherited from class MapleEvent
broadcast, getChannelServer, getMap, getType, givePrize, incrementPlayerCount, isRunning, mapLoad, onStartEvent, scheduleEvent, setEvent, warpBack
-
Constructor Details
-
MapleCoconut
-
-
Method Details
-
finished
- Specified by:
finishedin classMapleEvent
-
reset
public void reset()- Overrides:
resetin classMapleEvent
-
unreset
public void unreset()- Overrides:
unresetin classMapleEvent
-
onMapLoad
- Overrides:
onMapLoadin classMapleEvent
-
getCoconut
-
getAllCoconuts
-
setHittable
public void setHittable(boolean hittable) -
getBombings
public int getBombings() -
bombCoconut
public void bombCoconut() -
getFalling
public int getFalling() -
fallCoconut
public void fallCoconut() -
getStopped
public int getStopped() -
stopCoconut
public void stopCoconut() -
getCoconutScore
public int[] getCoconutScore() -
getMapleScore
public int getMapleScore() -
getStoryScore
public int getStoryScore() -
addMapleScore
public void addMapleScore() -
addStoryScore
public void addStoryScore() -
resetCoconutScore
public void resetCoconutScore() -
startEvent
public void startEvent()- Specified by:
startEventin classMapleEvent
-
bonusTime
public void bonusTime() -
warpOut
public void warpOut()
-