This commit is contained in:
2025-06-11 16:54:50 +08:00
parent 4096922e61
commit d06d8fe910
10 changed files with 295 additions and 141 deletions

View File

@@ -10,13 +10,14 @@ export enum EquipType {
// 基础属性加成
export enum EquipAttr {
ATK = 1, // 攻击力
HP = 2, // 生命值
ATK_COUNT = 3, // 攻击个数
ATK_CD = 4, // 攻击速度
SKILL_DMG = 5, // 技能效果
SKILL_CD = 6, // 技能冷却缩减
CARD_EFFECT = 7, // 卡牌效果
CARD_COUNT = 1, // 卡牌起效次数,每3次多起效一次
ATK_COUNT = 2, // 攻击个数
ATK_CD = 3, // 攻击速度
HP = 4, // 生命值
DEF = 5, // 免伤
SKILL_DMG = 6, // 技能效果
SKILL_CD = 7, // 技能冷却缩减
CARD_EFFECT = 8, // 卡牌效果
CARD_COUNT = 8, // 卡牌起效次数,每3次多起效一次
}
//装备属性起效对象
export enum EquipAttrTarget {
@@ -48,7 +49,7 @@ export enum EquipQuality {
export const weapon_id=[2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025]
export const armor_id=[2101,2102,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2117,2118,2119,2120,2121,2122]
export const accessory_id=[2201,2202,2203,2204,2205,2206,2207,2208,2209,2210,2211,2212,2213,2214,2215,2216,2217,2218,2219,2220,2221,2222,2223,2224,2225,2226,2227,2228,2229,2230]
export const equip_list=[2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2101,2102,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2117,2118,2119,2120,2121,2122,2201,2202,2203,2204,2205,2206,2207,2208,2209,2210,2211,2212,2213,2214,2215,2216,2217,2218,2219,2220,2221,2222,2223,2224,2225,2226,2227,2228,2229,2230]
export const equip_list=[2001,2002,2003,2004,2005]
// 装备属性加成接口
export interface EquipAttribute {
type: EquipAttr; // 属性类型
@@ -61,18 +62,35 @@ export interface EquipData {
uuid: number; // 装备唯一ID
name: string; // 装备名称
type: EquipType; // 装备类型
info: string; // 装备描述
attributes: EquipAttribute[]; // 属性加成列表
}
export const EquipInfo: { [key: number]: EquipData } = {
2001: {uuid: 2001, name: "新手剑", type: EquipType.WEAPON,
2001: {uuid: 2001, name: "新手剑", type: EquipType.WEAPON,info:"攻击力增加80%",
attributes: [
{ type: EquipAttr.ATK, value: 80, target: EquipAttrTarget.HERO },
]
},
2002: {uuid: 2002,name: "新手剑",type: EquipType.WEAPON,
2002: {uuid: 2002,name: "新手剑2",type: EquipType.WEAPON,info:"攻击速度增加30%",
attributes: [
{ type: EquipAttr.ATK_CD, value: 30, target: EquipAttrTarget.HERO },
]
},
2003: {uuid: 2003,name: "新手剑3",type: EquipType.WEAPON,info:"攻击次数增加1次",
attributes: [
{ type: EquipAttr.ATK_COUNT, value: 1, target: EquipAttrTarget.HERO },
]
},
2004: {uuid: 2004,name: "防具1",type: EquipType.ARMOR,info:"生命值增加100%",
attributes: [
{ type: EquipAttr.HP, value: 100, target: EquipAttrTarget.HERO },
]
},
2005: {uuid: 2005,name: "防具2",type: EquipType.ARMOR,info:"免伤增加50%",
attributes: [
{ type: EquipAttr.DEF, value: 50, target: EquipAttrTarget.HERO },
]
},
}

View File

@@ -48,41 +48,41 @@ export const MonSet = {
2:{pos:v3(320,-10,0)},
}
export const HeroInfo = {
5001:{uuid:5001,name:"神圣守护",path:"k2", lv:3,kind:1,type:0,hp:5,ap:10,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1,speed:100,skills:[6005],tals:"说明"},
5002:{uuid:5002,name:"幻影剑豪",path:"k1", lv:3,kind:2,type:0,hp:5,ap:10,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1,speed:100,skills:[6005],tals:"说明"},
5003:{uuid:5003,name:"战争领主",path:"k5", lv:3,kind:2,type:0,hp:5,ap:10,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1,speed:100,skills:[6005],tals:"说明"},
5004:{uuid:5004,name:"混沌法师",path:"zh1", lv:3,kind:2,type:2,hp:5,ap:10,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1.5,speed:100,skills:[6003],tals:"说明"},
5005:{uuid:5005,name:"火焰法师",path:"zh2", lv:3,kind:2,type:2,hp:5,ap:15,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1.5,speed:100,skills:[6003],tals:"说明"},
5006:{uuid:5006,name:"风暴精灵",path:"m4", lv:3,kind:2,type:2,hp:5,ap:15,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1.5,speed:100,skills:[6001],tals:"说明"},
5007:{uuid:5007,name:"生命圣者",path:"d1", lv:3,kind:2,type:2,hp:5,ap:10,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1.5,speed:100,skills:[6003],tals:"说明"},
5008:{uuid:5008,name:"战争祭祀",path:"d2", lv:3,kind:2,type:2,hp:5,ap:10,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1.5,speed:100,skills:[6003],tals:"说明"},
5009:{uuid:5009,name:"暴风射手",path:"a5", lv:3,kind:2,type:1,hp:5,ap:15,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1.2,speed:100,skills:[6006],tals:"说明"},
5010:{uuid:5010,name:"苍穹射手",path:"a3", lv:3,kind:1,type:1,hp:5,ap:15,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1.2,speed:100,skills:[6006],tals:"说明"},
5011:{uuid:5011,name:"幽灵射手",path:"a4", lv:3,kind:2,type:1,hp:5,ap:15,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1.2,speed:100,skills:[6006],tals:"说明"},
5201:{uuid:5201,name:"兽人战士",path:"mor1", lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:100,skills:[6005],tals:"说明"},
5202:{uuid:5202,name:"兽人刺客",path:"mor2", lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:100,skills:[6005],tals:"说明"},
5203:{uuid:5203,name:"兽人护卫",path:"mor3", lv:1,kind:1,type:1,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1.2,speed:100,skills:[6007],tals:"说明"},
5204:{uuid:5204,name:"石卫", path:"mgem1",lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:100,skills:[6005],tals:"说明"},
5205:{uuid:5205,name:"土卫", path:"mgem2",lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:100,skills:[6005],tals:"说明"},
5206:{uuid:5206,name:"树人", path:"mgem3",lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:100,skills:[6005],tals:"说明"},
5210:{uuid:5210,name:"骷髅战士",path:"mkl4", lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:100,skills:[6005],tals:"说明"},
5211:{uuid:5211,name:"骷髅战士",path:"mkl5", lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:100,skills:[6005],tals:"说明"},
5212:{uuid:5212,name:"骷髅战士",path:"mkl6", lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:100,skills:[6005],tals:"说明"},
5213:{uuid:5213,name:"骷髅射手",path:"mkla1",lv:1,kind:1,type:1,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1.2,speed:100,skills:[6005],tals:"说明"},
5214:{uuid:5214,name:"骷髅射手",path:"mkla2",lv:1,kind:1,type:1,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1.2,speed:100,skills:[6005],tals:"说明"},
5215:{uuid:5215,name:"骷髅射手",path:"mkla3",lv:1,kind:1,type:1,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1.2,speed:100,skills:[6005],tals:"说明"},
5216:{uuid:5216,name:"元素1", path:"my1", lv:2,kind:1,type:2,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:200,a_cd:1.5,speed:100,skills:[6001],tals:"说明"},
5217:{uuid:5217,name:"元素2", path:"my2", lv:2,kind:1,type:2,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:200,a_cd:1.5,speed:100,skills:[6002],tals:"说明"},
5218:{uuid:5218,name:"元素3", path:"my3", lv:2,kind:1,type:2,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:200,a_cd:1.5,speed:100,skills:[6003],tals:"说明"},
5219:{uuid:5219,name:"牛头战士",path:"mn1", lv:2,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:100,skills:[6005],tals:"说明"},
5220:{uuid:5220,name:"牛头战士",path:"mn2", lv:1,kind:1,type:1,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1.2,speed:100,skills:[6010],tals:"说明"},
5221:{uuid:5221,name:"牛头战士",path:"mn3", lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:100,skills:[6005],tals:"说明"},
5222:{uuid:5222,name:"独眼巨人",path:"md1", lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:100,skills:[6005],tals:"说明"},
5223:{uuid:5223,name:"独眼巨人",path:"md2", lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:100,skills:[6008],tals:"说明"},
5224:{uuid:5224,name:"独眼巨人",path:"md3", lv:1,kind:1,type:1,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1.2,speed:100,skills:[6005],tals:"说明"},
5225:{uuid:5225,name:"精英独眼",path:"md4", lv:3,kind:1,type:2,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:200,a_cd:1,speed:100,skills:[6009],tals:"说明"},
5226:{uuid:5226,name:"精英牛头",path:"mn4", lv:3,kind:1,type:2,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:200,a_cd:1,speed:100,skills:[6010],tals:"说明"},
5227:{uuid:5227,name:"精英兽人",path:"mor4", lv:3,kind:1,type:2,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:200,a_cd:1,speed:100,skills:[6009],tals:"说明"}
5001:{uuid:5001,name:"神圣守护",path:"k2", lv:3,kind:1,type:0,hp:5,ap:10,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1,speed:50,skills:[6001],tals:"说明"},
5002:{uuid:5002,name:"幻影剑豪",path:"k1", lv:3,kind:2,type:0,hp:5,ap:10,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1,speed:50,skills:[6001],tals:"说明"},
5003:{uuid:5003,name:"战争领主",path:"k5", lv:3,kind:2,type:0,hp:5,ap:10,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1,speed:50,skills:[6001],tals:"说明"},
5004:{uuid:5004,name:"混沌法师",path:"zh1", lv:3,kind:2,type:2,hp:5,ap:10,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1.5,speed:50,skills:[6001],tals:"说明"},
5005:{uuid:5005,name:"火焰法师",path:"zh2", lv:3,kind:2,type:2,hp:5,ap:15,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1.5,speed:50,skills:[6001],tals:"说明"},
5006:{uuid:5006,name:"风暴精灵",path:"m4", lv:3,kind:2,type:2,hp:5,ap:15,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1.5,speed:50,skills:[6001],tals:"说明"},
5007:{uuid:5007,name:"生命圣者",path:"d1", lv:3,kind:2,type:2,hp:5,ap:10,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1.5,speed:50,skills:[6001],tals:"说明"},
5008:{uuid:5008,name:"战争祭祀",path:"d2", lv:3,kind:2,type:2,hp:5,ap:10,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1.5,speed:50,skills:[6001],tals:"说明"},
5009:{uuid:5009,name:"暴风射手",path:"a5", lv:3,kind:2,type:1,hp:5,ap:15,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1.2,speed:50,skills:[6006],tals:"说明"},
5010:{uuid:5010,name:"苍穹射手",path:"a3", lv:3,kind:1,type:1,hp:5,ap:15,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1.2,speed:50,skills:[6006],tals:"说明"},
5011:{uuid:5011,name:"幽灵射手",path:"a4", lv:3,kind:2,type:1,hp:5,ap:15,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1.2,speed:50,skills:[6006],tals:"说明"},
5201:{uuid:5201,name:"兽人战士",path:"mor1", lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:50,skills:[6001],tals:"说明"},
5202:{uuid:5202,name:"兽人刺客",path:"mor2", lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:50,skills:[6001],tals:"说明"},
5203:{uuid:5203,name:"兽人护卫",path:"mor3", lv:1,kind:1,type:1,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1.2,speed:50,skills:[6001],tals:"说明"},
5204:{uuid:5204,name:"石卫", path:"mgem1",lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:50,skills:[6001],tals:"说明"},
5205:{uuid:5205,name:"土卫", path:"mgem2",lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:50,skills:[6001],tals:"说明"},
5206:{uuid:5206,name:"树人", path:"mgem3",lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:50,skills:[6001],tals:"说明"},
5210:{uuid:5210,name:"骷髅战士",path:"mkl4", lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:50,skills:[6001],tals:"说明"},
5211:{uuid:5211,name:"骷髅战士",path:"mkl5", lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:50,skills:[6001],tals:"说明"},
5212:{uuid:5212,name:"骷髅战士",path:"mkl6", lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:50,skills:[6001],tals:"说明"},
5213:{uuid:5213,name:"骷髅射手",path:"mkla1",lv:1,kind:1,type:1,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1.2,speed:50,skills:[6001],tals:"说明"},
5214:{uuid:5214,name:"骷髅射手",path:"mkla2",lv:1,kind:1,type:1,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1.2,speed:50,skills:[6001],tals:"说明"},
5215:{uuid:5215,name:"骷髅射手",path:"mkla3",lv:1,kind:1,type:1,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1.2,speed:50,skills:[6001],tals:"说明"},
5216:{uuid:5216,name:"元素1", path:"my1", lv:2,kind:1,type:2,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:200,a_cd:1.5,speed:50,skills:[6001],tals:"说明"},
5217:{uuid:5217,name:"元素2", path:"my2", lv:2,kind:1,type:2,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:200,a_cd:1.5,speed:50,skills:[6002],tals:"说明"},
5218:{uuid:5218,name:"元素3", path:"my3", lv:2,kind:1,type:2,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:200,a_cd:1.5,speed:50,skills:[6001],tals:"说明"},
5219:{uuid:5219,name:"牛头战士",path:"mn1", lv:2,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:50,skills:[6001],tals:"说明"},
5220:{uuid:5220,name:"牛头战士",path:"mn2", lv:1,kind:1,type:1,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1.2,speed:50,skills:[6001],tals:"说明"},
5221:{uuid:5221,name:"牛头战士",path:"mn3", lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:50,skills:[6001],tals:"说明"},
5222:{uuid:5222,name:"独眼巨人",path:"md1", lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:50,skills:[6001],tals:"说明"},
5223:{uuid:5223,name:"独眼巨人",path:"md2", lv:1,kind:1,type:0,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1,speed:50,skills:[6008],tals:"说明"},
5224:{uuid:5224,name:"独眼巨人",path:"md3", lv:1,kind:1,type:1,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:80,a_cd:1.2,speed:50,skills:[6001],tals:"说明"},
5225:{uuid:5225,name:"精英独眼",path:"md4", lv:3,kind:1,type:2,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:200,a_cd:1,speed:50,skills:[6001],tals:"说明"},
5226:{uuid:5226,name:"精英牛头",path:"mn4", lv:3,kind:1,type:2,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:200,a_cd:1,speed:50,skills:[6001],tals:"说明"},
5227:{uuid:5227,name:"精英兽人",path:"mor4", lv:3,kind:1,type:2,hp:200,ap:1,ap_u:0,ap_ur:0,hp_up:0,dis:200,a_cd:1,speed:50,skills:[6001],tals:"说明"}
};
export const HeroUpInfo = {
5001:{ap_up:0,ap_up_rate:10,self_ap_up:0,self_ap_up_rate:0,hp_up:0,self_hp_up:0},

View File

@@ -9,6 +9,7 @@ import { SkillSet, TargetGroup, TargetType } from "../common/config/SkillSet";
import { BuffComp } from "./BuffComp";
import { oops } from "db://oops-framework/core/Oops";
import { GameEvent } from "../common/config/GameEvent";
import { FightConComp } from "../map/FightConComp";
const { ccclass, property } = _decorator;
@@ -16,6 +17,7 @@ const { ccclass, property } = _decorator;
@ccclass('HeroViewComp') // 定义为 Cocos Creator 组件
@ecs.register('HeroView', false) // 定义为 ECS 组件
export class HeroViewComp extends CCComp {
FIGHTCON:FightConComp=null!
BUFFCOMP:BuffComp=null!
as: HeroSpine = null!
status:String = "idle"
@@ -84,6 +86,8 @@ export class HeroViewComp extends CCComp {
onLoad() {
this.as = this.getComponent(HeroSpine);
this.FIGHTCON=this.node.parent.getComponent(FightConComp);
console.log("hero view comp ",this.FIGHTCON)
// let anm = this.node.getChildByName("anm")
// anm.setScale(anm.scale.x*0.8,anm.scale.y*0.8);
// 注册单个碰撞体的回调函数

View File

@@ -8,12 +8,13 @@ import { GameEvent } from '../common/config/GameEvent';
import { BoxSet } from '../common/config/BoxSet';
import { smc } from '../common/SingletonModuleComp';
import { CCComp } from 'db://oops-framework/module/common/CCComp';
import { FightConComp } from '../map/FightConComp';
const { ccclass, property } = _decorator;
@ccclass('SkillCon')
@ecs.register('SkillCon')
export class SkillConComp extends CCComp {
FIGHTCON:FightConComp=null!
HeroView:any=null;
HeroEntity:any=null;
private _timers: { [key: string]: number } = {};
@@ -23,6 +24,7 @@ export class SkillConComp extends CCComp {
}
onLoad(){
this.HeroView=this.node.getComponent(HeroViewComp)
this.FIGHTCON=this.node.parent.getComponent(FightConComp)
// console.log(this.HeroView.uuid+"=>"+this.HeroView.hero_name+"=> SkillConComp onLoad")
this.on(GameEvent.CastHeroSkill,this.cast_master_skill,this)
}
@@ -36,7 +38,13 @@ export class SkillConComp extends CCComp {
if (this.HeroView.is_atking &&this.HeroView.at > this.HeroView.cd) {
const config = SkillSet[this.HeroView.atk_skill];
if (!config) return;
this.castSkill(config);
let count=1
if(this.HeroView.is_master){
count+=this.FIGHTCON.hero.ATK_COUNT+this.FIGHTCON.ally.ATK_COUNT
}else{
count+=this.FIGHTCON.friend.ATK_COUNT+this.FIGHTCON.ally.ATK_COUNT
}
this.castSkill(config,count);
this.HeroView.at = 0;
}
}
@@ -46,29 +54,29 @@ export class SkillConComp extends CCComp {
if(!this.HeroView.is_master) return
console.log("hart cast_skill",uuid ,e)
const config = SkillSet[uuid];
this.castSkill(config)
this.castSkill(config,(1+this.FIGHTCON.hero.ATK_COUNT+this.FIGHTCON.ally.ATK_COUNT))
}
/** 施放技能 */
castSkill(config: typeof SkillSet[keyof typeof SkillSet]) {
castSkill(config: typeof SkillSet[keyof typeof SkillSet],count:number=1) {
// console.log(view.uuid+"=>"+view.hero_name+"施放技能:"+config.uuid);
if (config.TargetGroup === TargetGroup.Enemy) {
this.HeroView.playSkillEffect(config.uuid);
this.doSkill(config);
this.doSkill(config,count);
}
if (config.TargetGroup === TargetGroup.Ally) {
const targets = this.selectAllyTargets( config);
if (targets.length === 0) return;
this.doSkill(config,count);
}
if (config.TargetGroup === TargetGroup.Self) {
this.doSkill(config,count);
}
}
private doSkill(config: typeof SkillSet[keyof typeof SkillSet]) {
private doSkill(config: typeof SkillSet[keyof typeof SkillSet],count:number=1) {
const skillEntity = ecs.getEntity<Skill>(Skill);
const targets = this.selectEnemyTargets(config);
if (targets.length === 0) return;

View File

@@ -16,36 +16,48 @@ export class EquipsComp extends Component {
boxs:Node=null
attrs:any={
hero:{
ap:0,
hp:0,
atk_count:0,
atk_speed:0,
skill_dmg:0,
skill_cd:0,
ATK:0, // 攻击力
ATK_COUNT:0, // 攻击个数
ATK_CD:0, // 攻击速度
HP:0, // 生命值
DEF:0, // 免伤
SKILL_DMG:0, // 技能效果
SKILL_CD:0, // 技能冷却缩减
CARD_EFFECT:0, // 卡牌效果
CARD_COUNT:0, // 卡牌起效次数,每3次多起效一次
},
ally:{
ap:0,
hp:0,
atk_count:0,
atk_speed:0,
skill_dmg:0,
skill_cd:0,
ATK:0, // 攻击力
ATK_COUNT:0, // 攻击个数
ATK_CD:0, // 攻击速度
HP:0, // 生命值
DEF:0, // 免伤
SKILL_DMG:0, // 技能效果
SKILL_CD:0, // 技能冷却缩减
CARD_EFFECT:0, // 卡牌效果
CARD_COUNT:0, // 卡牌起效次数,每3次多起效一次
},
enemy:{
ap:0,
hp:0,
atk_count:0,
atk_speed:0,
skill_dmg:0,
skill_cd:0,
ATK:0, // 攻击力
ATK_COUNT:0, // 攻击个数
ATK_CD:0, // 攻击速度
HP:0, // 生命值
DEF:0, // 免伤
SKILL_DMG:0, // 技能效果
SKILL_CD:0, // 技能冷却缩减
CARD_EFFECT:0, // 卡牌效果
CARD_COUNT:0, // 卡牌起效次数,每3次多起效一次
},
friend:{
ap:0,
hp:0,
atk_count:0,
atk_speed:0,
skill_dmg:0,
skill_cd:0,
ATK:0, // 攻击力
ATK_COUNT:0, // 攻击个数
ATK_CD:0, // 攻击速度
HP:0, // 生命值
DEF:0, // 免伤
SKILL_DMG:0, // 技能效果
SKILL_CD:0, // 技能冷却缩减
CARD_EFFECT:0, // 卡牌效果
CARD_COUNT:0, // 卡牌起效次数,每3次多起效一次
}
}
/** 视图层逻辑代码分离演示 */
@@ -63,13 +75,13 @@ export class EquipsComp extends Component {
this.boxs.getChildByName("armor").getChildByName("icon").active=false
this.boxs.getChildByName("accessory").getChildByName("icon").active=false
this.weapon={
uuid:2001,
uuid:0,
name:"weapon",
type:"weapon",
level:0,
}
this.armor={
uuid:2002,
uuid:0,
name:"armor",
type:"armor",
level:0,
@@ -105,6 +117,7 @@ export class EquipsComp extends Component {
this.accessory.level=data.level
this.show_accessory(data.uuid)
}
this.count_attrs()
}
show_weapon(uuid:number){
let icon = this.node.getChildByName("boxs").getChildByName("weapon").getChildByName("icon")
@@ -154,27 +167,37 @@ export class EquipsComp extends Component {
if (targetKey) {
switch (attr.type) {
case EquipAttr.ATK:
this.attrs[targetKey].ap += attr.value;
break;
case EquipAttr.HP:
this.attrs[targetKey].hp += attr.value;
this.attrs[targetKey].ATK += attr.value;
break;
case EquipAttr.ATK_COUNT:
this.attrs[targetKey].atk_count += attr.value;
this.attrs[targetKey].ATK_COUNT += attr.value;
break;
case EquipAttr.ATK_SPEED:
this.attrs[targetKey].atk_speed += attr.value;
case EquipAttr.ATK_CD:
this.attrs[targetKey].ATK_CD += attr.value;
break;
case EquipAttr.HP:
this.attrs[targetKey].HP += attr.value;
break;
case EquipAttr.DEF:
this.attrs[targetKey].DEF += attr.value;
break;
case EquipAttr.SKILL_DMG:
this.attrs[targetKey].skill_dmg += attr.value;
this.attrs[targetKey].SKILL_DMG += attr.value;
break;
case EquipAttr.SKILL_SPEED:
this.attrs[targetKey].skill_cd += attr.value;
case EquipAttr.SKILL_CD:
this.attrs[targetKey].SKILL_CD += attr.value;
break;
case EquipAttr.CARD_EFFECT:
this.attrs[targetKey].CARD_EFFECT += attr.value;
break;
case EquipAttr.CARD_COUNT:
this.attrs[targetKey].CARD_COUNT += attr.value;
break;
}
}
});
console.log("count_attrs",this.attrs)
oops.message.dispatchEvent(GameEvent.EquipChange,this.attrs)
}
// 重置所有属性为0

View File

@@ -5,40 +5,51 @@ const { ccclass, property } = _decorator;
@ccclass('FightConComp')
export class FightConComp extends Component {
attrs:any={
hero:{
ap:0,
hp:0,
atk_count:0,
atk_speed:0,
skill_dmg:0,
skill_cd:0,
},
ally:{
ap:0,
hp:0,
atk_count:0,
atk_speed:0,
skill_dmg:0,
skill_cd:0,
},
enemy:{
ap:0,
hp:0,
atk_count:0,
atk_speed:0,
skill_dmg:0,
skill_cd:0,
},
friend:{
ap:0,
hp:0,
atk_count:0,
atk_speed:0,
skill_dmg:0,
skill_cd:0,
}
hero:{
ATK:0, // 攻击力
ATK_COUNT:0, // 攻击个数
ATK_CD:0, // 攻击速度
HP:0, // 生命值
DEF:0, // 免伤
SKILL_DMG:0, // 技能效果
SKILL_CD:0, // 技能冷却缩减
CARD_EFFECT:0, // 卡牌效果
CARD_COUNT:0, // 卡牌起效次数,每3次多起效一次
}
ally:{
ATK:0, // 攻击力
ATK_COUNT:0, // 攻击个数
ATK_CD:0, // 攻击速度
HP:0, // 生命值
DEF:0, // 免伤
SKILL_DMG:0, // 技能效果
SKILL_CD:0, // 技能冷却缩减
CARD_EFFECT:0, // 卡牌效果
CARD_COUNT:0, // 卡牌起效次数,每3次多起效一次
}
enemy:{
ATK:0, // 攻击力
ATK_COUNT:0, // 攻击个数
ATK_CD:0, // 攻击速度
HP:0, // 生命值
DEF:0, // 免伤
SKILL_DMG:0, // 技能效果
SKILL_CD:0, // 技能冷却缩减
CARD_EFFECT:0, // 卡牌效果
CARD_COUNT:0, // 卡牌起效次数,每3次多起效一次
}
friend:{
ATK:0, // 攻击力
ATK_COUNT:0, // 攻击个数
ATK_CD:0, // 攻击速度
HP:0, // 生命值
DEF:0, // 免伤
SKILL_DMG:0, // 技能效果
SKILL_CD:0, // 技能冷却缩减
CARD_EFFECT:0, // 卡牌效果
CARD_COUNT:0, // 卡牌起效次数,每3次多起效一次
}
onLoad(){
// console.log("fight con start")
oops.message.on(GameEvent.EquipChange,this.equip_change,this)
@@ -46,19 +57,22 @@ export class FightConComp extends Component {
}
equip_change(e:GameEvent,equip:any){
this.attrs.hero=equip.hero
this.attrs.ally=equip.ally
this.attrs.enemy=equip.enemy
this.attrs.friend=equip.friend
this.hero=equip.hero
this.ally=equip.ally
this.enemy=equip.enemy
this.friend=equip.friend
}
fight_ready(e:GameEvent){
this.attrs.hero=this.attrs.ally=this.attrs.enemy=this.attrs.friend={
ap:0,
hp:0,
atk_count:0,
atk_speed:0,
skill_dmg:0,
skill_cd:0,
this.hero=this.ally=this.enemy=this.friend={
ATK:0, // 攻击力
ATK_COUNT:0, // 攻击个数
ATK_CD:0, // 攻击速度
HP:0, // 生命值
DEF:0, // 免伤
SKILL_DMG:0, // 技能效果
SKILL_CD:0, // 技能冷却缩减
CARD_EFFECT:0, // 卡牌效果
CARD_COUNT:0, // 卡牌起效次数,每3次多起效一次
}
}

View File

@@ -3,13 +3,14 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
import { BoxSet } from "../common/config/BoxSet";
import { SkillSet } from "../common/config/SkillSet";
import { smc } from "../common/SingletonModuleComp";
import { FightConComp } from "../map/FightConComp";
import { SkillCom } from "./SkillCom";
import { instantiate, Node, Prefab, Vec3 ,tween, v3,animation,Label,resources,SpriteFrame,Sprite} from "cc";
/** Skill 模块 */
@ecs.register(`Skill`)
export class Skill extends ecs.Entity {
FIGHTCON:FightConComp=null!
SkillView!: SkillCom;
/** 实始添加的数据层组件 */
protected init() {
@@ -29,6 +30,7 @@ export class Skill extends ecs.Entity {
targetPos: Vec3, // 目标位置
caster:any=null // 施法者
) {
let FIGHTCON=parent.getComponent(FightConComp);
const config = SkillSet[uuid];
if (!config) return;
@@ -44,6 +46,15 @@ export class Skill extends ecs.Entity {
// 添加技能组件
const skillComp = node.getComponent(SkillCom); // 初始化技能参数
skillComp.ap = caster.ap;
if(caster.fac==0){
if(caster.is_master){
skillComp.ap=Math.floor(skillComp.ap*(100+FIGHTCON.hero.ATK+FIGHTCON.ally.ATK)/100);
}else{
skillComp.ap=Math.floor(skillComp.ap*(100+FIGHTCON.friend.ATK+FIGHTCON.ally.ATK)/100);
}
}else{
skillComp.ap=Math.floor(skillComp.ap*(100-FIGHTCON.enemy.ATK)/100);
}
skillComp.s_uuid = uuid;
skillComp.animType = config.AnimType;
skillComp.endType = config.endType;

View File

@@ -9,6 +9,7 @@ import { EndAnmCom } from './EndAnmCom';
import { BoxSet } from "../common/config/BoxSet";
import { HeroFac, HeroSet } from "../common/config/heroSet";
import { HeroViewComp } from "../hero/HeroViewComp";
import { BezierMove } from "../BezierMove/BezierMove";
const { ccclass, property } = _decorator;
@@ -17,7 +18,7 @@ const { ccclass, property } = _decorator;
@ccclass('SkillCom')
@ecs.register('SkillCom')
export class SkillCom extends CCComp {
BezierMove:BezierMove=null!;
s_uuid:number = 0;
s_name:string = "";
hero:number = 0;
@@ -49,6 +50,7 @@ export class SkillCom extends CCComp {
}
start() {
this.BezierMove=this.node.getComponent(BezierMove)
oops.message.on(GameEvent.MissionEnd, this.doDestroy, this);
this.node.active = true;
let collider = this.getComponent(Collider2D);