From c9fdca90fb1ed4bb2ac76a017b158df92f7f6a4f Mon Sep 17 00:00:00 2001 From: walkpan Date: Thu, 1 Jan 2026 14:02:23 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8A=80=E8=83=BD=E7=B3=BB=E7=BB=9F):=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8A=80=E8=83=BD=E9=80=BB=E8=BE=91=E5=B9=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E6=8A=80=E8=83=BD=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将hasAllyInSkillRange重命名为hasTeamInSkillRange以更好反映功能 - 修正治疗和护盾技能的计算公式,改为基于最大生命值的百分比 - 为所有技能添加10点消耗值 - 新增6102和6103两个团队增益技能配置 - 注释掉物理调试绘制代码 - 添加游戏设计文档初始内容 --- assets/script/Design4.md | 1 + assets/script/Main.ts | 10 ++++---- assets/script/game/common/config/SkillSet.ts | 24 ++++++++++++++------ assets/script/game/hero/SACastSystem.ts | 8 +++---- 4 files changed, 27 insertions(+), 16 deletions(-) create mode 100644 assets/script/Design4.md diff --git a/assets/script/Design4.md b/assets/script/Design4.md new file mode 100644 index 00000000..751cddbb --- /dev/null +++ b/assets/script/Design4.md @@ -0,0 +1 @@ +你正在开发一个 手机小游戏,已1个玩家角色在固定位置对抗源源不断从右边刷入的怪物,固定一局为15分钟,采用肉鸽模式,怪物 \ No newline at end of file diff --git a/assets/script/Main.ts b/assets/script/Main.ts index 4cae125c..bb5c2a5b 100644 --- a/assets/script/Main.ts +++ b/assets/script/Main.ts @@ -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); diff --git a/assets/script/game/common/config/SkillSet.ts b/assets/script/game/common/config/SkillSet.ts index f74aae11..4a4944e6 100644 --- a/assets/script/game/common/config/SkillSet.ts +++ b/assets/script/game/common/config/SkillSet.ts @@ -159,36 +159,46 @@ export interface SkillConfig { export const SkillSet: Record = { 5000:{uuid:5000,name:"反伤",sp_name:"thorns",icon:"3036",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single,DType:DType.ATK, - ap:0,map:0,cd:0,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, + ap:0,map:0,cd:0,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,cost:10,with:0,dis:80,ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd, buffs:[],neAttrs:[],info:"反伤", }, // ========== 基础攻击 ========== 6001-6099 6001: { uuid:6001,name:"挥击",sp_name:"atk_s1",icon:"3036",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single,DType:DType.ATK, - ap:100,map:0,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, + ap:100,map:0,cd:1,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,cost:10,with:0,dis:80,ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd, buffs:[],neAttrs:[],info:"向最前方敌人扔出石斧,造成100%攻击的伤害", }, 6002: { 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,map:0,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, + ap:100,map:0,cd:1,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,cost:10,with:0,dis:80,ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd, buffs:[],neAttrs:[],info:"向最前方敌人扔出石斧,造成100%攻击的伤害", }, 6005: { uuid:6005,name:"水球",sp_name:"m_water_ball_1",icon:"3039",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single,DType:DType.ICE, - ap:100,map:0,cd:5,t_num:1,hit_num:1,hit:2,hitcd:0.3,speed:720,cost:0,with:90,dis:360,ready:8001,EAnm:0,DAnm:9001,RType:RType.linear,EType:EType.collision, + ap:100,map:0,cd:5,t_num:1,hit_num:1,hit:2,hitcd:0.3,speed:720,cost:10,with:90,dis:360,ready:8001,EAnm:0,DAnm:9001,RType:RType.linear,EType:EType.collision, buffs:[],neAttrs:[],info:"召唤水球攻击前方敌人,造成100%魔法攻击的伤害", }, // ========== 基础buff ========== 6100-6199 6100: { uuid:6100,name:"治疗",sp_name:"buff_wind",icon:"3036",TGroup:TGroup.Self,SType:SType.heal,act:"atk",DTType:DTType.single,DType:DType.ATK, - ap:30,map:0,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, + ap:30,map:0,cd:1,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,cost:10,with:0,dis:720,ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd, buffs:[],neAttrs:[],info:"治疗自己,回复30%最大生命值", }, 6101:{ uuid:6101,name:"魔法盾",sp_name:"buff_wind",icon:"3036",TGroup:TGroup.Self,SType:SType.shield,act:"atk",DTType:DTType.single,DType:DType.WIND, - ap:30,map:0,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, + ap:30,map:0,cd:1,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,cost:10,with:0,dis:720,ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd, buffs:[],neAttrs:[],info:"获得30%最大生命值的护盾", - } + }, + 6102:{ + uuid:6102,name:"强壮",sp_name:"buff_wind",icon:"3036",TGroup:TGroup.Team,SType:SType.buff,act:"atk",DTType:DTType.single,DType:DType.WIND, + ap:30,map:0,cd:1,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,cost:10,with:0,dis:720,ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd, + buffs:[],neAttrs:[],info:"增加目标10%攻击力,持续30秒", + }, + 6103:{ + uuid:6103,name:"群体强壮",sp_name:"buff_wind",icon:"3036",TGroup:TGroup.Team,SType:SType.buff,act:"atk",DTType:DTType.single,DType:DType.WIND, + ap:30,map:0,cd:1,t_num:3,hit_num:1,hit:1,hitcd:0.2,speed:720,cost:10,with:0,dis:720,ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd, + buffs:[],neAttrs:[],info:"增加目标10%攻击力,持续30秒", + }, }; diff --git a/assets/script/game/hero/SACastSystem.ts b/assets/script/game/hero/SACastSystem.ts index 0b28c16c..cca65179 100644 --- a/assets/script/game/hero/SACastSystem.ts +++ b/assets/script/game/hero/SACastSystem.ts @@ -63,7 +63,7 @@ export class SACastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdat if (config.SType === SType.damage) { if (!this.hasEnemyInSkillRange(heroView, heroAttrs, skill.dis)) continue; } else if (config.SType === SType.heal || config.SType === SType.shield) { - if (!this.hasAllyInSkillRange(heroView, heroAttrs, skill.dis)) continue; + if (!this.hasTeamInSkillRange(heroView, heroAttrs, skill.dis)) continue; } // ✅ 开始执行施法 @@ -364,7 +364,7 @@ export class SACastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdat /** * 检查技能范围内是否有友军 */ - private hasAllyInSkillRange(heroView: HeroViewComp, heroAttrs: HeroAttrsComp, skillDistance: number): boolean { + private hasTeamInSkillRange(heroView: HeroViewComp, heroAttrs: HeroAttrsComp, skillDistance: number): boolean { if (!heroView || !heroView.node) return false; const currentPos = heroView.node.position; @@ -397,7 +397,7 @@ export class SACastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdat const targets = this.sHealTargets(heroView, hAttrsCom, config); if (targets.length === 0) return false; - const healAmount = config.ap * hAttrsCom.Attrs[Attrs.HP_MAX]; + const healAmount = config.ap * hAttrsCom.Attrs[Attrs.HP_MAX]/100; const delay = 0.3; heroView.scheduleOnce(() => { @@ -425,7 +425,7 @@ export class SACastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdat const targets = this.sShieldTargets(heroView, hAttrsCom, config); if (targets.length === 0) return false; - const shieldAmount = config.ap * hAttrsCom.Attrs[Attrs.HP_MAX]; + const shieldAmount = config.ap * hAttrsCom.Attrs[Attrs.HP_MAX]/100; const delay = 0.3; heroView.scheduleOnce(() => {