Browse Source

修改额外敌人变量

lanyunfei 23 hours ago
parent
commit
8523412ecb

+ 1 - 1
assets/script/ECS/components/ComRole.ts

@@ -71,5 +71,5 @@ export class ComRole {
     //掉落
     //掉落
     public drop: idNum
     public drop: idNum
     // 是否是额外投放敌人
     // 是否是额外投放敌人
-    public isAddEnemy: boolean
+    public isExtraEnemy: boolean
 }
 }

+ 2 - 2
assets/script/ECS/systems/SysRoleState.ts

@@ -117,7 +117,7 @@ export class SysRoleState extends ECSSystem {
                         (comRole.roleCfg.type == MONSTER_TYPE.boss ||
                         (comRole.roleCfg.type == MONSTER_TYPE.boss ||
                             comRole.roleCfg.type == MONSTER_TYPE.elite ||
                             comRole.roleCfg.type == MONSTER_TYPE.elite ||
                             comRole.roleCfg.type == MONSTER_TYPE.normal) &&
                             comRole.roleCfg.type == MONSTER_TYPE.normal) &&
-                        !comRole.isAddEnemy
+                        !comRole.isExtraEnemy
                     ) {
                     ) {
                         if (comRole.roleCfg.type == MONSTER_TYPE.elite) {
                         if (comRole.roleCfg.type == MONSTER_TYPE.elite) {
                             world.gameUI.eliteNum += 1
                             world.gameUI.eliteNum += 1
@@ -174,7 +174,7 @@ export class SysRoleState extends ECSSystem {
                         //同步spine死亡
                         //同步spine死亡
                         comSpineNode?.events.push(new EventDie())
                         comSpineNode?.events.push(new EventDie())
                     }
                     }
-                    if (!comRole.isAddEnemy) world.gameUI.handleDie(entity)
+                    world.gameUI.handleDie(entity)
                     //移除buff特效
                     //移除buff特效
                     for (let buff of comRole.buffs) {
                     for (let buff of comRole.buffs) {
                         for (let aniEntity of buff.aniEntityArr) {
                         for (let aniEntity of buff.aniEntityArr) {

+ 2 - 2
assets/script/ECS/worlds/WorldCocosView.ts

@@ -153,7 +153,7 @@ export class WorldCocosView extends ECSWorld {
         posCfgID?: number,
         posCfgID?: number,
         iRole?: IRole,
         iRole?: IRole,
         dropOutGoods?: idNum,
         dropOutGoods?: idNum,
-        isAddEnemy?: boolean,
+        isExtraEnemy?: boolean,
     ): EntityIndex {
     ): EntityIndex {
         let roleCfg: IRoleConfig
         let roleCfg: IRoleConfig
         if (typeof IDOrCfg == 'number') {
         if (typeof IDOrCfg == 'number') {
@@ -312,7 +312,7 @@ export class WorldCocosView extends ECSWorld {
         comRole.lastHP = comRole.HP
         comRole.lastHP = comRole.HP
         comRole.shieldHP = 0
         comRole.shieldHP = 0
         comRole.lastShieldHP = 0
         comRole.lastShieldHP = 0
-        comRole.isAddEnemy = isAddEnemy
+        comRole.isExtraEnemy = isExtraEnemy
         //处理gameUI显示
         //处理gameUI显示
         if (this.gameUI) {
         if (this.gameUI) {
             let entities = this.gameUI.roleEntityMap.get(roleCfg.ID)
             let entities = this.gameUI.roleEntityMap.get(roleCfg.ID)

+ 5 - 5
assets/script/ui/GameUI.ts

@@ -239,7 +239,7 @@ export default class GameUI extends BaseUI {
     private timeRolesPos: number[]
     private timeRolesPos: number[]
     private timeRolesDrop: idNum[]
     private timeRolesDrop: idNum[]
     private createEnemyNum: number
     private createEnemyNum: number
-    private addEnemyArr: boolean[]
+    private extraEnemyCreateArr: boolean[]
     private rightAreaFriend: number[] = []
     private rightAreaFriend: number[] = []
 
 
     protected onLoad() {
     protected onLoad() {
@@ -1024,7 +1024,7 @@ export default class GameUI extends BaseUI {
 
 
         this.roundNextRoleTime = this.timeRolesTime[this.curRoundCreateIndex]
         this.roundNextRoleTime = this.timeRolesTime[this.curRoundCreateIndex]
         if ('additional' in this.curRoundCfg) {
         if ('additional' in this.curRoundCfg) {
-            this.addEnemyArr = new Array(this.curRoundCfg.additional.map(v => v).length).fill(false)
+            this.extraEnemyCreateArr = new Array(this.curRoundCfg.additional.map(v => v).length).fill(false)
         }
         }
     }
     }
 
 
@@ -1617,8 +1617,8 @@ export default class GameUI extends BaseUI {
         this.rightAreaFriend = this.rightAreaFriend.filter(v => !this.world.isDie(v))
         this.rightAreaFriend = this.rightAreaFriend.filter(v => !this.world.isDie(v))
         this.rightAreaFriend.push(entity)
         this.rightAreaFriend.push(entity)
         if ('extraRoles' in this.curRoundCfg) {
         if ('extraRoles' in this.curRoundCfg) {
-            for (let i = 0; i < this.addEnemyArr.length; i++) {
-                if (!this.addEnemyArr[i] && this.rightAreaFriend.length >= this.curRoundCfg.additional[i]) {
+            for (let i = 0; i < this.extraEnemyCreateArr.length; i++) {
+                if (!this.extraEnemyCreateArr[i] && this.rightAreaFriend.length >= this.curRoundCfg.additional[i]) {
                     for (let j = 0; j < this.curRoundCfg.addNum[i]; j++) {
                     for (let j = 0; j < this.curRoundCfg.addNum[i]; j++) {
                         this.world.createRoleEntity(
                         this.world.createRoleEntity(
                             this.getRoleCfgByCfgID(this.curRoundCfg.extraRoles[i]),
                             this.getRoleCfgByCfgID(this.curRoundCfg.extraRoles[i]),
@@ -1629,7 +1629,7 @@ export default class GameUI extends BaseUI {
                             true,
                             true,
                         )
                         )
                     }
                     }
-                    this.addEnemyArr[i] = true
+                    this.extraEnemyCreateArr[i] = true
                 }
                 }
             }
             }
         }
         }