制作了多个 近战技能

This commit is contained in:
2025-11-04 17:25:48 +08:00
parent 53cf25d7a5
commit afbaa13cb2
28 changed files with 2625 additions and 126 deletions

View File

@@ -12,11 +12,11 @@ const { ccclass, property } = _decorator;
@ccclass('Main')
export class Main extends Root {
start() {
// PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb
// |EPhysics2DDrawFlags.Pair
// |EPhysics2DDrawFlags.CenterOfMass
// |EPhysics2DDrawFlags.Joint
// |EPhysics2DDrawFlags.Shape;
PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb
|EPhysics2DDrawFlags.Pair
|EPhysics2DDrawFlags.CenterOfMass
|EPhysics2DDrawFlags.Joint
|EPhysics2DDrawFlags.Shape;
}
protected async run() {
smc.initialize = ecs.getEntity<Initialize>(Initialize);

View File

@@ -156,7 +156,7 @@ export const SkillSet: Record<number, SkillConfig> = {
buffs:[],neAttrs:[],info:"向最前方敌人扔出石斧,造成100%攻击的伤害",
},
6002: {
uuid:6002,name:"挥砍",sp_name:"atk_s2",icon:"3036",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single,DType:DType.ATK,
uuid:6002,name:"挥砍",sp_name:"atk_s4",icon:"3036",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single,DType:DType.ATK,
ap:100,cd:1,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,cost:0,with:0,dis:80,ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd,
buffs:[],neAttrs:[],info:"向最前方敌人扔出石斧,造成100%攻击的伤害",
},

View File

@@ -110,7 +110,7 @@ export const HeroInfo: Record<number, heroInfo> = {
// 刘邦 - 领导型战士(善于用人,知人善任)
5001:{uuid:5001,name:"刘邦",path:"hk1", fac:FacSet.HERO, kind:1,as:1.5,
type:HType.warrior,lv:1,hp:1000,mp:85,map:10,def:9,mdef:0,ap:15,dis:100,speed:120,skills:[6001],
type:HType.warrior,lv:1,hp:1000,mp:85,map:10,def:9,mdef:0,ap:15,dis:100,speed:120,skills:[6002],
buff:[],tal:[7101,7201,7301],info:"楚汉争霸领袖,领导统御型战士"},
// 荆轲 - 刺客(敏捷型,高速度和暴击率)

View File

@@ -63,7 +63,7 @@ export class HeroMoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpd
// 英雄阵营特殊逻辑:根据职业区分行为
const hasEnemies = this.checkEnemiesExist(e);
const isWarrior = model.type === HType.warrior;
const isWarrior = model.type === HType.warrior||model.type===HType.assassin;
// 战士职业:有敌人就向敌人前进
if (isWarrior && hasEnemies) {

View File

@@ -218,7 +218,7 @@ export class HeroViewComp extends CCComp {
var prefab: Prefab = oops.res.get(path, Prefab)!;
var node = instantiate(prefab);
node.setScale(node.scale.x * scale, node.scale.y);
node.setPosition(this.node.position.x, this.node.position.y+8, this.node.position.z);
node.setPosition(this.node.position.x, this.node.position.y+50, this.node.position.z);
node.parent = this.node.parent;
}

View File

@@ -28,7 +28,7 @@ export class Initialize extends ecs.Entity {
// 加载自定义资
this.loadCustom(queue);
// 加载多语言包
this.loadLanguage(queue);
// this.loadLanguage(queue);
// 加载公共资源
this.loadCommon(queue);
// 加载游戏内容加载进度提示界面

View File

@@ -1,6 +1,6 @@
import { instantiate, Node, Prefab, v3, Vec3 } from "cc";
import { BoxCollider2D, instantiate, Node, Prefab, v3, Vec3 } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { SkillSet } from "../common/config/SkillSet";
import { EType, SkillSet } from "../common/config/SkillSet";
import { oops } from "db://oops-framework/core/Oops";
import { HeroAttrsComp } from "../hero/HeroAttrsComp";
@@ -50,23 +50,30 @@ export class Skill extends ecs.Entity {
var scene = smc.map.MapView.scene;
node.parent = scene.entityLayer!.node!.getChildByName("SKILL")!;
// 设置节点属性
node.setPosition(startPos);
if(caster.node.scale.x < 0){
node.setScale(v3(node.scale.x*-1,node.scale.y,1))
}
let face=caster.node.scale.x < 0 ? -1 : 1
node.setScale(v3(node.scale.x*face,node.scale.y,1))
// 初始视图
const SView = node.getComponent(SkillView);
if(config.EType!=EType.collision){
const collider=node.getComponent(BoxCollider2D);
if(collider){
collider.enabled=false
}
}
// 只设置必要的运行时属性,配置信息通过 SkillSet[uuid] 访问
// 核心标识
SView.s_uuid= s_uuid
SView.group= caster.box_group
this.add(SView);
startPos.x=startPos.x+SView.atk_x
startPos.x=startPos.x+SView.atk_x*face
startPos.y=startPos.y+SView.atk_y
node.setPosition(startPos);
// 初始化移动组件 - 从SkillView获取移动参数
const sMoveCom = this.get(SMoveDataComp);
sMoveCom.startPos.set(startPos);
sMoveCom.targetPos.set(targetPos);