Class MapleReactor
java.lang.Object
server.maps.MapleMapObject
server.maps.MapleReactor
地圖上的反應爐物件,實作為
MapleMapObject 子類別。
反應爐是可被玩家(或道具)互動的地圖物件,依 MapleReactorStats 定義的狀態機推進
state;每個狀態可指定超時時間(delay)、觸發條件與下一個狀態。
主要職責包含:
- 維護當前狀態
state與存活旗標alive - 透過
Timer.MapTimer排程自動超時復原 - 觸發後由
ReactorScriptManager執行對應的 GraalJS 腳本 - 封包組裝依賴
CField(生成/狀態變更/移除)
反應爐的靜態資料(狀態表、碰撞框)由 MapleReactorStats 持有;
地圖上所有反應爐的生命周期由 MapReactorManager 協作者管理。
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddelayedDestroyReactor(long delay) voiddelayedHitReactor(MapleClient c, long delay) voidforceHitReactor(byte newState) voidvoidgetArea()intgetDelay()final bytegetMap()getName()intintbytegetState()bytegetTouch()getType()voidhitReactor(int charPos, short stance, MapleClient c) voidbooleanisAlive()booleanisCustom()booleanvoidscheduleSetState(byte oldState, byte newState, long delay) voidsendDestroyData(MapleClient client) voidsendSpawnData(MapleClient client) voidsetAlive(boolean alive) voidsetCustom(boolean c) voidsetDelay(int delay) final voidsetFacingDirection(byte facingDirection) voidvoidvoidsetState(byte state) voidsetTimerActive(boolean active) toString()Methods inherited from class MapleMapObject
getObjectId, getPosition, getRange, getTruePosition, setObjectId, setPosition
-
Constructor Details
-
MapleReactor
-
-
Method Details
-
setCustom
public void setCustom(boolean c) -
isCustom
public boolean isCustom() -
setFacingDirection
public final void setFacingDirection(byte facingDirection) -
getFacingDirection
public final byte getFacingDirection() -
setTimerActive
public void setTimerActive(boolean active) -
isTimerActive
public boolean isTimerActive() -
getReactorId
public int getReactorId() -
setState
public void setState(byte state) -
getState
public byte getState() -
isAlive
public boolean isAlive() -
setAlive
public void setAlive(boolean alive) -
setDelay
public void setDelay(int delay) -
getDelay
public int getDelay() -
getType
- Specified by:
getTypein classMapleMapObject
-
getReactorType
public int getReactorType() -
getTouch
public byte getTouch() -
setMap
-
getMap
-
getReactItem
-
sendDestroyData
- Specified by:
sendDestroyDatain classMapleMapObject
-
sendSpawnData
- Specified by:
sendSpawnDatain classMapleMapObject
-
forceStartReactor
-
forceHitReactor
public void forceHitReactor(byte newState) -
hitReactor
-
forceTrigger
public void forceTrigger() -
delayedDestroyReactor
public void delayedDestroyReactor(long delay) -
hitReactor
-
getArea
-
getName
-
setName
-
toString
-
delayedHitReactor
-
scheduleSetState
public void scheduleSetState(byte oldState, byte newState, long delay)
-