feat(技能系统): 优化技能逻辑并添加新技能配置
- 将hasAllyInSkillRange重命名为hasTeamInSkillRange以更好反映功能 - 修正治疗和护盾技能的计算公式,改为基于最大生命值的百分比 - 为所有技能添加10点消耗值 - 新增6102和6103两个团队增益技能配置 - 注释掉物理调试绘制代码 - 添加游戏设计文档初始内容
This commit is contained in:
1
assets/script/Design4.md
Normal file
1
assets/script/Design4.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
你正在开发一个 手机小游戏,已1个玩家角色在固定位置对抗源源不断从右边刷入的怪物,固定一局为15分钟,采用肉鸽模式,怪物
|
||||||
@@ -12,11 +12,11 @@ const { ccclass, property } = _decorator;
|
|||||||
@ccclass('Main')
|
@ccclass('Main')
|
||||||
export class Main extends Root {
|
export class Main extends Root {
|
||||||
start() {
|
start() {
|
||||||
PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb
|
// PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb
|
||||||
|EPhysics2DDrawFlags.Pair
|
// |EPhysics2DDrawFlags.Pair
|
||||||
|EPhysics2DDrawFlags.CenterOfMass
|
// |EPhysics2DDrawFlags.CenterOfMass
|
||||||
|EPhysics2DDrawFlags.Joint
|
// |EPhysics2DDrawFlags.Joint
|
||||||
|EPhysics2DDrawFlags.Shape;
|
// |EPhysics2DDrawFlags.Shape;
|
||||||
}
|
}
|
||||||
protected async run() {
|
protected async run() {
|
||||||
smc.initialize = ecs.getEntity<Initialize>(Initialize);
|
smc.initialize = ecs.getEntity<Initialize>(Initialize);
|
||||||
|
|||||||
@@ -159,36 +159,46 @@ export interface SkillConfig {
|
|||||||
|
|
||||||
export const SkillSet: Record<number, SkillConfig> = {
|
export const SkillSet: Record<number, SkillConfig> = {
|
||||||
5000:{uuid:5000,name:"反伤",sp_name:"thorns",icon:"3036",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single,DType:DType.ATK,
|
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:"反伤",
|
buffs:[],neAttrs:[],info:"反伤",
|
||||||
},
|
},
|
||||||
// ========== 基础攻击 ========== 6001-6099
|
// ========== 基础攻击 ========== 6001-6099
|
||||||
6001: {
|
6001: {
|
||||||
uuid:6001,name:"挥击",sp_name:"atk_s1",icon:"3036",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single,DType:DType.ATK,
|
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%攻击的伤害",
|
buffs:[],neAttrs:[],info:"向最前方敌人扔出石斧,造成100%攻击的伤害",
|
||||||
},
|
},
|
||||||
6002: {
|
6002: {
|
||||||
uuid:6002,name:"挥砍",sp_name:"atk_s4",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,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%攻击的伤害",
|
buffs:[],neAttrs:[],info:"向最前方敌人扔出石斧,造成100%攻击的伤害",
|
||||||
},
|
},
|
||||||
6005: {
|
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,
|
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%魔法攻击的伤害",
|
buffs:[],neAttrs:[],info:"召唤水球攻击前方敌人,造成100%魔法攻击的伤害",
|
||||||
},
|
},
|
||||||
// ========== 基础buff ========== 6100-6199
|
// ========== 基础buff ========== 6100-6199
|
||||||
6100: {
|
6100: {
|
||||||
uuid:6100,name:"治疗",sp_name:"buff_wind",icon:"3036",TGroup:TGroup.Self,SType:SType.heal,act:"atk",DTType:DTType.single,DType:DType.ATK,
|
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%最大生命值",
|
buffs:[],neAttrs:[],info:"治疗自己,回复30%最大生命值",
|
||||||
},
|
},
|
||||||
6101:{
|
6101:{
|
||||||
uuid:6101,name:"魔法盾",sp_name:"buff_wind",icon:"3036",TGroup:TGroup.Self,SType:SType.shield,act:"atk",DTType:DTType.single,DType:DType.WIND,
|
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%最大生命值的护盾",
|
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秒",
|
||||||
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export class SACastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdat
|
|||||||
if (config.SType === SType.damage) {
|
if (config.SType === SType.damage) {
|
||||||
if (!this.hasEnemyInSkillRange(heroView, heroAttrs, skill.dis)) continue;
|
if (!this.hasEnemyInSkillRange(heroView, heroAttrs, skill.dis)) continue;
|
||||||
} else if (config.SType === SType.heal || config.SType === SType.shield) {
|
} 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;
|
if (!heroView || !heroView.node) return false;
|
||||||
|
|
||||||
const currentPos = heroView.node.position;
|
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);
|
const targets = this.sHealTargets(heroView, hAttrsCom, config);
|
||||||
if (targets.length === 0) return false;
|
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;
|
const delay = 0.3;
|
||||||
|
|
||||||
heroView.scheduleOnce(() => {
|
heroView.scheduleOnce(() => {
|
||||||
@@ -425,7 +425,7 @@ export class SACastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdat
|
|||||||
const targets = this.sShieldTargets(heroView, hAttrsCom, config);
|
const targets = this.sShieldTargets(heroView, hAttrsCom, config);
|
||||||
if (targets.length === 0) return false;
|
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;
|
const delay = 0.3;
|
||||||
|
|
||||||
heroView.scheduleOnce(() => {
|
heroView.scheduleOnce(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user