Browse Source

战斗系统

chenwb10023 1 tuần trước cách đây
mục cha
commit
fe2927bab6

+ 2 - 0
assets/script/data/model/Battle/BattleModel.ts

@@ -4,9 +4,11 @@ import UEBattleRole from "../../../logic/battle/UEBattleRole";
 
 export default class BattleModel extends IDataModel {
     battleRoleList: { [id: string]: UEBattleRole } = {}
+    realBattleSpeed: number;
 
 	constructor() {
 		super("battle");
+		this.realBattleSpeed = 1.3;
 	}
 
 	

+ 10 - 4
assets/script/logic/battle/UEBattleRole.ts

@@ -11,6 +11,7 @@ export default class UEBattleRole extends UERole {
     m_IsLoadComplete: boolean;
     team: FightTeam;
     type: FightType;
+    posX: number;
 
     onLoad() {
         this.m_ResSpine = this.node.getChildByName("spine").getComponent(ResSpine);
@@ -24,12 +25,13 @@ export default class UEBattleRole extends UERole {
         this.team = team;
         this.type = type;
         this.node.x = posX;
+        this.posX = posX;
         this.LoadRoleRes();
     }
 
     GetSpinePath() {
         let spinePath = "role/nv";
-        if (this.team?.fid == "20") {
+        if (this.team?.fid == "1022") {
             spinePath = "mon/10001";
         }
         return spinePath;
@@ -44,7 +46,7 @@ export default class UEBattleRole extends UERole {
             if (asset) {
 
             }
-            
+
 
             if (that.m_ResSpine && that.m_ResSpine.isValid) {
                 that.m_ResSpine.addEventListener(that.OnEventListener.bind(that));
@@ -55,15 +57,19 @@ export default class UEBattleRole extends UERole {
         }, false, "stand", true, 1);
     }
 
+    playAni(aniName: string, loop: boolean, showLast?: boolean) {
+        this.m_ResSpine.playAnimation(aniName, loop, showLast);
+    }
+
     /** 监听事件帧 */
     OnEventListener(name: string) {
         // console.log("角色事件帧", name);
         if (name === "skill" || name === "atk") {
-            
+
         }
     }
 
     OnCompleteListener(name: string) {
-        
+
     }
 }

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 898 - 898
assets/script/logic/battle/UEBattleView.ts


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác