Class MapleMiniGame
java.lang.Object
server.maps.MapleMapObject
server.shops.AbstractPlayerStore
server.shops.MapleMiniGame
- All Implemented Interfaces:
IMaplePlayerShop
玩家對戰小遊戲攤位的伺服端實作,支援五目棋(Omok)與翻牌配對(Match Card)。
以 IMaplePlayerShop.OMOK 或 IMaplePlayerShop.MATCH_CARD 型別標識,
固定兩人對弈(slots = 2)。主要特性如下:
- 五目棋:維護 15×15 棋盤陣列(
piece),每步呼叫searchCombo判定五連; 勝負透過PlayerShopPacket.getMiniGameResult(MapleMiniGame, int, int)廣播。 - 翻牌配對:以
matchcards清單配對牌組,局前透過shuffleList洗牌。 piecetype決定比局制(0=6局、1=10局、2=15局),達標後由checkWin結算。- 勝負記錄同步至任務進度(
MapleQuestStatus),可觸發五目棋/翻牌相關任務計數。
PlayerInteractionHandler 的 MINI_GAME_* opcode
驅動每一步落子;封包由 PlayerShopPacket 組裝。-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractPlayerStore
AbstractPlayerStore.BoughtItem -
Field Summary
Fields inherited from class AbstractPlayerStore
available, bought, channel, chrs, des, itemId, items, map, meso, open, owneraccount, ownerId, ownerName, pass, visitorsFields inherited from interface IMaplePlayerShop
HIRED_MERCHANT, MATCH_CARD, OMOK, PLAYER_SHOP -
Constructor Summary
ConstructorsConstructorDescriptionMapleMiniGame(MapleCharacter owner, int itemId, String description, String pass, int GameType) -
Method Summary
Modifier and TypeMethodDescriptionvoidbuy(MapleClient c, int z, short i) voidvoidcheckWin()voidcloseShop(boolean s, boolean z) voidexit(MapleCharacter player) intgetCardId(int slot) getData(MapleCharacter chr) intintgetLoser()intgetLosses(MapleCharacter chr) intintgetOwnerPoints(int slot) intintintintgetScore(MapleCharacter chr) byteintgetTies(MapleCharacter chr) intgetTurn()intgetWins(MapleCharacter chr) booleanisExitAfter(MapleCharacter player) booleanisReady(int slot) voidvoidreset()booleansearchCombo(int x, int y, int type) voidsend(MapleClient c) voidsetExitAfter(MapleCharacter player) voidsetFirstSlot(int type) voidvoidsetLoser(int type) voidsetPiece(int move1, int move2, int type, MapleCharacter chr) voidsetPieceType(int type) voidsetPoints(int slot) voidsetPoints(int i, int type) voidsetReady(int slot) voidsetRequestedTie(int t) voidsetTurn(int t) voidMethods inherited from class AbstractPlayerStore
addItem, addVisitor, broadcastToVisitors, broadcastToVisitors, broadcastToVisitors, getBoughtItems, getDescription, getFreeSlot, getGameType, getItemId, getItems, getMap, getMaxSize, getMCOwner, getMCOwnerChannel, getMCOwnerWorld, getMeso, getOwnerAccId, getOwnerId, getOwnerName, getPassword, getSize, getType, getVisitor, getVisitors, getVisitorSlot, isAvailable, isOpen, isOwner, removeAllVisitors, removeFromSlot, removeItem, removeVisitor, saveItems, sendDestroyData, sendSpawnData, setAvailable, setMeso, setOpen, updateMethods inherited from class MapleMapObject
getObjectId, getPosition, getRange, getTruePosition, setObjectId, setPosition
-
Constructor Details
-
MapleMiniGame
public MapleMiniGame(MapleCharacter owner, int itemId, String description, String pass, int GameType)
-
-
Method Details
-
reset
public void reset() -
setFirstSlot
public void setFirstSlot(int type) -
getFirstSlot
public int getFirstSlot() -
setPoints
public void setPoints(int slot) -
getPoints
public int getPoints() -
checkWin
public void checkWin() -
getOwnerPoints
public int getOwnerPoints(int slot) -
setPieceType
public void setPieceType(int type) -
getPieceType
public int getPieceType() -
setGameType
public void setGameType() -
shuffleList
public void shuffleList() -
getCardId
public int getCardId(int slot) -
getMatchesToWin
public int getMatchesToWin() -
setLoser
public void setLoser(int type) -
getLoser
public int getLoser() -
send
-
setReady
public void setReady(int slot) -
isReady
public boolean isReady(int slot) -
setPiece
-
nextLoser
public void nextLoser() -
exit
-
isExitAfter
-
setExitAfter
-
checkExitAfterGame
public void checkExitAfterGame() -
searchCombo
public boolean searchCombo(int x, int y, int type) -
getScore
-
getShopType
public byte getShopType() -
getWins
-
getTies
-
getLosses
-
setPoints
public void setPoints(int i, int type) -
getData
-
getRequestedTie
public int getRequestedTie() -
setRequestedTie
public void setRequestedTie(int t) -
getTurn
public int getTurn() -
setTurn
public void setTurn(int t) -
closeShop
public void closeShop(boolean s, boolean z) -
buy
-