mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
update
This commit is contained in:
@@ -8,16 +8,14 @@ import { v3 } from "cc";
|
||||
import { bezier } from "cc";
|
||||
import { v2 } from "cc";
|
||||
import { Vec2 } from "cc";
|
||||
import { sp } from "cc";
|
||||
import GEffectUtil from "../../effect/GEffectUtil";
|
||||
import { TableGRoleAttackEffect } from "../../../../resources/config/ts/TableGRoleAttackEffect";
|
||||
import GDetection from "../common/GDetection";
|
||||
import { rect } from "cc";
|
||||
import { UITransform } from "cc";
|
||||
import { BoxCollider2D } from "cc";
|
||||
|
||||
/**
|
||||
* 抛物线 爆炸普攻
|
||||
* 攻击子弹,爆炸特效,龙骨-初始位置,子弹大小
|
||||
* 攻击子弹,爆炸特效,龙骨-初始位置,子弹大小,爆炸宽度,爆炸高度
|
||||
*/
|
||||
export default class GAttackParabolicRemote implements GAttackBase{
|
||||
|
||||
@@ -26,7 +24,6 @@ export default class GAttackParabolicRemote implements GAttackBase{
|
||||
let enemy = role.fsm.enemy;
|
||||
if(!enemy) return;
|
||||
|
||||
//[子弹图片]
|
||||
let image:SpriteFrame = app.role.bullets[info.attackArgs[0]];
|
||||
let bang = {
|
||||
ske: app.role.effects[info.attackArgs[1]],
|
||||
|
@@ -149,14 +149,17 @@ export default abstract class GFSMBattle extends GFSMBase{
|
||||
this.player.fsmAnim.isAttack = true;
|
||||
//如果有敌人则攻击 没有 则 重置
|
||||
if(this.enemy){
|
||||
// if(){
|
||||
// //如果可以释放大招
|
||||
// }else{
|
||||
// //不可以则普攻
|
||||
//朝向敌人
|
||||
this.player.onTowardsTarget(this.enemy);
|
||||
return GFSMProcessEnum.Wait;
|
||||
// }
|
||||
|
||||
//是否可释放技能
|
||||
if(this.player.isReleaseSkill()){
|
||||
//则释放技能
|
||||
return ProcessEnum.ReleaseSkills;
|
||||
}else{
|
||||
return GFSMProcessEnum.Wait;
|
||||
}
|
||||
|
||||
}else{
|
||||
return ProcessEnum.SeekEnemy;
|
||||
}
|
||||
@@ -165,6 +168,21 @@ export default abstract class GFSMBattle extends GFSMBase{
|
||||
//释放技能
|
||||
onReleaseSkillsProcess(){
|
||||
|
||||
//如果正在释放则等待
|
||||
if(this.player.isReleasingSkill()){
|
||||
return GFSMProcessEnum.Wait;
|
||||
}
|
||||
|
||||
//释放技能
|
||||
if(this.player.isReleaseSkill()){
|
||||
//如果可以释放技能则释放
|
||||
this.player.onReleaseSkill();
|
||||
return GFSMProcessEnum.Wait;
|
||||
}else{
|
||||
//不可以则回到攻击
|
||||
return ProcessEnum.AttackEnemy;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,5 +1,8 @@
|
||||
import { sp } from "cc";
|
||||
import GFSMBase, { GFSMProcessEnum, GFSMProcessInfo, GFSMProcessMode } from "../../GFSMBase";
|
||||
import GRoleBase from "../../../role/GRoleBase";
|
||||
import GRolePVPEntity from "../../../role/PVP/GRolePVPEntity";
|
||||
import GObject from "../../../GObject";
|
||||
|
||||
//角色动画名称枚举
|
||||
export enum GFSMBattleAminEnum {
|
||||
@@ -63,7 +66,8 @@ export class GFSMBattleAmin extends GFSMBase{
|
||||
this.trackIndex = trackIndex || 0;
|
||||
//设置监听
|
||||
this.spine.setEventListener(this.onEventListener.bind(this));
|
||||
this.spine.setStartListener(this.onStartListener.bind(this));
|
||||
//因为SpineBUG所以不使用Spine监听 采用自己调用
|
||||
// this.spine.setStartListener(this.onStartListener.bind(this));
|
||||
}
|
||||
|
||||
//添加事件监听
|
||||
@@ -176,8 +180,9 @@ export class GFSMBattleAmin extends GFSMBase{
|
||||
|
||||
//播放动画
|
||||
if(!info.track){
|
||||
console.log("播放动画",info);
|
||||
console.log(`播放动画-${this.spine.getComponent(GObject).nId}-`,info);
|
||||
info.track = this.spine.setAnimation(this.trackIndex,info.animName,info.isLoop);
|
||||
this.onStartListener(info.track);
|
||||
}
|
||||
|
||||
return to;
|
||||
|
@@ -13,7 +13,7 @@ import { TableGRoleAttack } from "../../../../resources/config/ts/TableGRoleAtta
|
||||
import { GAttack, GAttackBase } from "../attack/GAttack";
|
||||
import { TableGRole } from "../../../../resources/config/ts/TableGRole";
|
||||
import { TableGRoleSkill } from "../../../../resources/config/ts/TableGRoleSkill";
|
||||
import { GSkill, GSkillBase } from "../../skill/GSkill";
|
||||
import { GSkill, GSkillBase, GSkillState } from "../../skill/GSkill";
|
||||
import JNSkeleton from "../../../../../extensions/ngame/assets/ngame/sync/frame/game/spine/JNFrameSkeleton";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -131,9 +131,8 @@ export default abstract class GRoleBase<T> extends GObject<T>{
|
||||
this.fsm && this.fsm.onUpdate(dt / 1000);
|
||||
this.fsmAnim && this.fsmAnim.onUpdate(dt / 1000);
|
||||
|
||||
if(frame.index == 100){
|
||||
this.skills[0] && this.skills[0].release();
|
||||
}
|
||||
//更新技能
|
||||
this.skills.forEach(skill => skill.onUpdate(dt));
|
||||
|
||||
}
|
||||
|
||||
@@ -227,12 +226,13 @@ export default abstract class GRoleBase<T> extends GObject<T>{
|
||||
//击飞
|
||||
onFly(){
|
||||
|
||||
console.log("onFly");
|
||||
if(this.nId == 1)
|
||||
console.log("onFly");
|
||||
let vWorld = this.node.worldPosition;
|
||||
let vEndWorld = this.getWorldBackLen(v2(1000,500));
|
||||
this.JTween(vWorld)
|
||||
.to({x:vEndWorld.x},800)
|
||||
.onUpdate(pos => this.node.worldPosition = vWorld)
|
||||
.onUpdate(pos => this.node.worldPosition = pos)
|
||||
.start();
|
||||
this.JTween(vWorld)
|
||||
.to({y:vEndWorld.y},800)
|
||||
@@ -252,6 +252,37 @@ export default abstract class GRoleBase<T> extends GObject<T>{
|
||||
return roles.filter(role => role.type != this.type);
|
||||
}
|
||||
|
||||
//判断是否可以释放技能
|
||||
isReleaseSkill():boolean{
|
||||
for (const skill of this.skills) {
|
||||
if(skill.isRelease()){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//释放技能
|
||||
onReleaseSkill():boolean{
|
||||
for (const skill of this.skills) {
|
||||
if(skill.isRelease()){
|
||||
skill.release();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//是否正在释放技能
|
||||
isReleasingSkill():boolean {
|
||||
for (const skill of this.skills) {
|
||||
if(skill.state() == GSkillState.Releasing){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@@ -51,6 +51,10 @@ export default class GRolePVPEntity extends GRoleBase<GDemoMessage>{
|
||||
|
||||
//更新显示
|
||||
this.bloodVolume.progress = this.blood / this.fullBlood;
|
||||
//显示第一个技能进度条
|
||||
if(this.skills[0]){
|
||||
this.energyVolume.progress = this.skills[0].getProgress();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user