mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 10:46:17 +00:00
update
This commit is contained in:
@@ -4,18 +4,53 @@ import GFSMBase from "../../fsm/GFSMBase";
|
||||
import GFSMPVP from "../../fsm/PVP/GFSMPVP";
|
||||
import GPVPMode, { GPVPModePlayerEnum } from "../../../PVP/GPVPMode";
|
||||
import { GTactical } from "../../../entity/GTactical";
|
||||
import { GFSMBattleAmin } from "../../fsm/base/GFSMBattle/GFSMBattleAmin";
|
||||
import { JNFrameInfo } from "../../../../../../extensions/ngame/assets/ngame/sync/frame/JNSyncFrame";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
export interface GDemoMessage{
|
||||
isAttack?:boolean;
|
||||
isRun?:boolean;
|
||||
}
|
||||
|
||||
//PVP 角色
|
||||
@ccclass('GRolePVPEntity')
|
||||
export default class GRolePVPEntity extends GRoleBase<{}>{
|
||||
export default class GRolePVPEntity extends GRoleBase<GDemoMessage>{
|
||||
|
||||
//所属阵容
|
||||
ones:GPVPModePlayerEnum;
|
||||
_ones:GPVPModePlayerEnum;
|
||||
|
||||
get ones():GPVPModePlayerEnum{
|
||||
return this._ones;
|
||||
}
|
||||
set ones(value:GPVPModePlayerEnum){
|
||||
//如果是敌方则设置镜像
|
||||
if(value == GPVPModePlayerEnum.ENEMY){
|
||||
this.isMirror = true;
|
||||
}else{
|
||||
this.isMirror = false;
|
||||
}
|
||||
this._ones = value;
|
||||
}
|
||||
|
||||
//攻击距离
|
||||
|
||||
//在阵容中的下标
|
||||
tacticalIndex:number;
|
||||
tactical:GTactical;
|
||||
|
||||
getClassName():string{return "GDemoMessage"}
|
||||
onSyncUpdate(dt: number,frame:JNFrameInfo, input?: GDemoMessage) {
|
||||
super.onSyncUpdate(dt,frame,input);
|
||||
if(input){
|
||||
if(Object.prototype.hasOwnProperty.call(input,"isAttack")){
|
||||
this.fsmAnim.isAttack = input.isAttack;
|
||||
}
|
||||
if(Object.prototype.hasOwnProperty.call(input,"isRun")){
|
||||
this.fsmAnim.isMove = input.isRun;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
get mode():GPVPMode{
|
||||
@@ -25,9 +60,13 @@ export default class GRolePVPEntity extends GRoleBase<{}>{
|
||||
this._mode = value;
|
||||
}
|
||||
|
||||
protected fsmCreate(): GFSMBase {
|
||||
protected fsmCreate(): GFSMPVP {
|
||||
return null;
|
||||
return new GFSMPVP(this);
|
||||
}
|
||||
protected fsmAnimCreate(): GFSMBattleAmin {
|
||||
return new GFSMBattleAmin(this.spine);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user