|
@@ -88,17 +88,45 @@ export class SysSkillAbel extends ECSSystem {
|
|
if (comSkillAbel.skillConfig.hitID) {
|
|
if (comSkillAbel.skillConfig.hitID) {
|
|
world.createAni(comSkillAbel.skillConfig.hitID, undefined, comSkillAbel.skillBulletPos)
|
|
world.createAni(comSkillAbel.skillConfig.hitID, undefined, comSkillAbel.skillBulletPos)
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ //让技能可以重新被施放
|
|
|
|
+ let curSkillIndex = comRole.skills.findIndex(value => value.ID == comSkillAbel.skillConfig.ID)
|
|
|
|
+ if (curSkillIndex >= 0) {
|
|
|
|
+ comRole.skillCountDowns[curSkillIndex] = comRole.castTime[curSkillIndex]
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- } else if (comSkillAbel.skillConfig.type == SKILL_TYPE.ejectionSkillBullet) {
|
|
|
|
- comSkillAbel.bullets = []
|
|
|
|
- let cfg =
|
|
|
|
- comSkillAbel.skillConfig.effectParm[
|
|
|
|
- comSkillAbel.skillConfig.effectType.indexOf(SKILL_EFFECT_TYPE.skillBullet)
|
|
|
|
- ]
|
|
|
|
- let bulletNum = cfg[1]
|
|
|
|
- for (let i = 0; i < bulletNum; i++) {
|
|
|
|
|
|
+ }
|
|
|
|
+ comSkillAbel.bullets = []
|
|
|
|
+ comSkillAbel.skillBulletTime = this.getSkillBulletInverter(comSkillAbel)
|
|
|
|
+ comSkillAbel.skillBulletNum = 0
|
|
|
|
+ comSkillAbel.startDirty = false
|
|
|
|
+ }
|
|
|
|
+ //发射多枚技能子弹
|
|
|
|
+ if (
|
|
|
|
+ comSkillAbel.skillConfig.type == SKILL_TYPE.skillBullet ||
|
|
|
|
+ comSkillAbel.skillConfig.type == SKILL_TYPE.ejectionSkillBullet
|
|
|
|
+ ) {
|
|
|
|
+ let skillBulletParams =
|
|
|
|
+ comSkillAbel.skillConfig.effectParm[
|
|
|
|
+ comSkillAbel.skillConfig.effectType.indexOf(SKILL_EFFECT_TYPE.skillBullet)
|
|
|
|
+ ]
|
|
|
|
+ let bulletNum = skillBulletParams[1]
|
|
|
|
+ comSkillAbel.skillBulletTime -= dt
|
|
|
|
+ if (comSkillAbel.skillBulletTime <= 0 && comSkillAbel.skillBulletNum < bulletNum) {
|
|
|
|
+ comSkillAbel.skillBulletNum += 1
|
|
|
|
+ //0是吟唱时间平均值
|
|
|
|
+ comSkillAbel.skillBulletTime = this.getSkillBulletInverter(comSkillAbel)
|
|
|
|
+ if (comSkillAbel.skillConfig.type == SKILL_TYPE.skillBullet) {
|
|
|
|
+ world.createRoleSkillBulletEntity(
|
|
|
|
+ skillBulletParams[0],
|
|
|
|
+ entity,
|
|
|
|
+ BulletConfig[skillBulletParams[0]]?.type == BULLET_TYPE.normal ? comSkillAbel.roles[0] : 0,
|
|
|
|
+ Boolean(skillBulletParams[3]),
|
|
|
|
+ comSkillAbel.skillBulletPos,
|
|
|
|
+ )
|
|
|
|
+ } else if (comSkillAbel.skillConfig.type == SKILL_TYPE.ejectionSkillBullet) {
|
|
let tmp = world.createRoleSkillBulletEntity(
|
|
let tmp = world.createRoleSkillBulletEntity(
|
|
- cfg[0],
|
|
|
|
|
|
+ skillBulletParams[0],
|
|
entity,
|
|
entity,
|
|
0,
|
|
0,
|
|
false,
|
|
false,
|
|
@@ -113,27 +141,6 @@ export class SysSkillAbel extends ECSSystem {
|
|
if (tmp) comSkillAbel.bullets.push(tmp)
|
|
if (tmp) comSkillAbel.bullets.push(tmp)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- comSkillAbel.startDirty = false
|
|
|
|
- }
|
|
|
|
- //发射多枚技能子弹
|
|
|
|
- if (comSkillAbel.skillConfig.type == SKILL_TYPE.skillBullet) {
|
|
|
|
- let bulletNum =
|
|
|
|
- comSkillAbel.skillConfig.effectParm[
|
|
|
|
- comSkillAbel.skillConfig.effectType.indexOf(SKILL_EFFECT_TYPE.skillBullet)
|
|
|
|
- ][1]
|
|
|
|
- comSkillAbel.skillBulletTime -= dt
|
|
|
|
- if (bulletNum > 1 && comSkillAbel.skillBulletTime <= 0) {
|
|
|
|
- comSkillAbel.skillBulletTime = comSkillAbel.castSkillTime / (bulletNum - 1)
|
|
|
|
- world.createRoleSkillBulletEntity(
|
|
|
|
- comSkillAbel.skillConfig.effectParm[
|
|
|
|
- comSkillAbel.skillConfig.effectType.indexOf(SKILL_EFFECT_TYPE.skillBullet)
|
|
|
|
- ][0],
|
|
|
|
- entity,
|
|
|
|
- 0,
|
|
|
|
- true,
|
|
|
|
- comSkillAbel.skillBulletPos,
|
|
|
|
- )
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
comSkillAbel.countDown -= dt
|
|
comSkillAbel.countDown -= dt
|
|
if (comSkillAbel.countDown <= comSkillAbel.castSkillTime && comSkillAbel.skillDirty) {
|
|
if (comSkillAbel.countDown <= comSkillAbel.castSkillTime && comSkillAbel.skillDirty) {
|
|
@@ -287,30 +294,6 @@ export class SysSkillAbel extends ECSSystem {
|
|
comRole.HPDirty = true
|
|
comRole.HPDirty = true
|
|
comRole.transDirty = true
|
|
comRole.transDirty = true
|
|
comTransRole.transID = comRole.roleCfg.ID
|
|
comTransRole.transID = comRole.roleCfg.ID
|
|
- } else if (comSkillAbel.skillConfig.type == SKILL_TYPE.skillBullet) {
|
|
|
|
- let bulletID =
|
|
|
|
- comSkillAbel.skillConfig.effectParm[
|
|
|
|
- comSkillAbel.skillConfig.effectType.indexOf(SKILL_EFFECT_TYPE.skillBullet)
|
|
|
|
- ][0]
|
|
|
|
- let bulletConfig = BulletConfig[bulletID]
|
|
|
|
- if (bulletConfig) {
|
|
|
|
- let bulletEntity = world.createRoleSkillBulletEntity(
|
|
|
|
- bulletID,
|
|
|
|
- entity,
|
|
|
|
- bulletConfig.type == BULLET_TYPE.normal ? comSkillAbel.roles[0] : 0,
|
|
|
|
- false,
|
|
|
|
- bulletConfig.type == BULLET_TYPE.normal ? null : comSkillAbel.skillBulletPos,
|
|
|
|
- )
|
|
|
|
- if (!bulletEntity) {
|
|
|
|
- let curSkillIndex = comRole.skills.findIndex(
|
|
|
|
- value => value.ID == comSkillAbel.skillConfig.ID,
|
|
|
|
- )
|
|
|
|
- if (curSkillIndex >= 0) {
|
|
|
|
- //让技能可以重新被施放
|
|
|
|
- comRole.skillCountDowns[curSkillIndex] = comRole.castTime[curSkillIndex]
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
//放技能加血
|
|
//放技能加血
|
|
if (comRole.entryMap.get(ENTRY.skillRestoreHP)?.num > 0) {
|
|
if (comRole.entryMap.get(ENTRY.skillRestoreHP)?.num > 0) {
|
|
@@ -320,18 +303,27 @@ export class SysSkillAbel extends ECSSystem {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (comSkillAbel.countDown <= 0) {
|
|
if (comSkillAbel.countDown <= 0) {
|
|
- comSkillAbel.isInShield = false
|
|
|
|
- comSkillAbel.skillConfig = null
|
|
|
|
- comSkillAbel.roles.length = 0
|
|
|
|
- comSkillAbel.dirty = false
|
|
|
|
if (comSkillAbel.bullets) {
|
|
if (comSkillAbel.bullets) {
|
|
comSkillAbel.bullets.forEach(v => {
|
|
comSkillAbel.bullets.forEach(v => {
|
|
world.removeBulletEntity(v)
|
|
world.removeBulletEntity(v)
|
|
})
|
|
})
|
|
comSkillAbel.bullets.length = 0
|
|
comSkillAbel.bullets.length = 0
|
|
}
|
|
}
|
|
|
|
+ comSkillAbel.isInShield = false
|
|
|
|
+ comSkillAbel.skillConfig = null
|
|
|
|
+ comSkillAbel.roles.length = 0
|
|
|
|
+ comSkillAbel.dirty = false
|
|
}
|
|
}
|
|
return false
|
|
return false
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ getSkillBulletInverter(comSkillAbel: ComSkillAbel): number {
|
|
|
|
+ let cfg =
|
|
|
|
+ comSkillAbel.skillConfig.effectParm[
|
|
|
|
+ comSkillAbel.skillConfig.effectType.indexOf(SKILL_EFFECT_TYPE.skillBullet)
|
|
|
|
+ ]
|
|
|
|
+ if (!cfg) return 0
|
|
|
|
+ return cfg[2] ? cfg[2] : +(comSkillAbel.castSkillTime / cfg[1]).toFixed(1)
|
|
|
|
+ }
|
|
}
|
|
}
|