mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
简单的PVP
This commit is contained in:
@@ -6,8 +6,15 @@ import { GUI } from "../ui/UIConfig";
|
||||
import BaseAction from "./BaseAction";
|
||||
|
||||
export interface GPVPStart{
|
||||
leftTactical:string;
|
||||
rightTactical:string;
|
||||
leftTactical:string; //左边玩家的阵法
|
||||
leftPets:{[key:number]:string}; //左边玩家的宠物
|
||||
rightTactical:string; //右边玩家的阵法
|
||||
rightPets:{[key:number]:string}; //左边玩家的宠物
|
||||
}
|
||||
|
||||
|
||||
export interface GPVPText{
|
||||
text:string
|
||||
}
|
||||
|
||||
export default class PVPAction extends BaseAction {
|
||||
@@ -16,6 +23,7 @@ export default class PVPAction extends BaseAction {
|
||||
app.socket.on(GAction.C_MODE_PVP_START_WAIT,this.onModePVPStartWait,this);
|
||||
app.socket.on(GAction.C_MODE_PVP_END_WAIT,this.onModePVPEndWait,this);
|
||||
app.socket.on(GAction.C_MODE_PVP_START,this.onModePVPStart,this,GActionType.GPVPStart);
|
||||
app.socket.on(GAction.C_MODE_PVP_MESSAGE,this.onModePVPMessage,this,GActionType.GPVPText);
|
||||
}
|
||||
|
||||
//PVP开始等待
|
||||
@@ -33,7 +41,13 @@ export default class PVPAction extends BaseAction {
|
||||
//开始PVP
|
||||
onModePVPStart(info:GPVPStart){
|
||||
console.log("开始PVP",info);
|
||||
GBattleModeManager.getIns().Open(BattleMode.PVP,true);
|
||||
GBattleModeManager.getIns().Open(BattleMode.PVP,true,info);
|
||||
}
|
||||
|
||||
//提示
|
||||
onModePVPMessage(info:GPVPText){
|
||||
console.log("提示PVP",info);
|
||||
app.layer.Open(GUI.Tips,{text:info.text})
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user