装备技能转变 触发+伙伴死亡 被攻击触发

This commit is contained in:
2025-06-18 10:58:18 +08:00
parent fdfa9cbd37
commit be4543b62e
9 changed files with 305 additions and 74 deletions

View File

@@ -35,6 +35,8 @@ export enum EquipSpecialAttr {
ATK_ADD_GLOD=7, //金币增加
ATK_ADD_MASTER_ATK=8, //主将攻击力增加
ATK_ADD_MASTER_HP=9, //主将生命值增加
DOUBLE_DEAD=10, //双倍死亡触发
DOUBLE_ATKED=11, //双倍受击触发
}
export enum EquipQuality {
WHITE = 1,
@@ -47,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]
export const equip_list=[2001,2002,2003,]
// 装备属性加成接口
export interface EquipAttribute {
type: BuffAttr; // 属性类型
@@ -78,6 +80,9 @@ export const EquipInfo: { [key: number]: EquipData } = {
2001: {uuid: 2001, name: "新手剑", type: EquipType.WEAPON,info:"攻击力增加80%",
special_attr: [
{special_attr:EquipSpecialAttr.ATK_ADD_FRIEND_ATK,special_attr_value:3},
{special_attr:EquipSpecialAttr.ICE,special_attr_value:1},
{special_attr:EquipSpecialAttr.DOUBLE_DEAD,special_attr_value:1},
{special_attr:EquipSpecialAttr.DOUBLE_ATKED,special_attr_value:1},
{special_attr:EquipSpecialAttr.ATK_ADD_FRIEND_HP,special_attr_value:30},
{special_attr:EquipSpecialAttr.ATK_ADD_GLOD,special_attr_value:3},
{special_attr:EquipSpecialAttr.ATK_ADD_MASTER_ATK,special_attr_value:3},
@@ -92,6 +97,9 @@ export const EquipInfo: { [key: number]: EquipData } = {
},
2002: {uuid: 2002,name: "新手剑2",type: EquipType.WEAPON,info:"攻击速度增加30%",
special_attr:[
{special_attr:EquipSpecialAttr.FIRE,special_attr_value:1},
{special_attr:EquipSpecialAttr.DOUBLE_DEAD,special_attr_value:1},
{special_attr:EquipSpecialAttr.DOUBLE_ATKED,special_attr_value:1},
{special_attr:EquipSpecialAttr.ATK_ADD_FRIEND_ATK,special_attr_value:3},
{special_attr:EquipSpecialAttr.ATK_ADD_FRIEND_HP,special_attr_value:30},
{special_attr:EquipSpecialAttr.ATK_ADD_GLOD,special_attr_value:3},
@@ -107,6 +115,9 @@ export const EquipInfo: { [key: number]: EquipData } = {
},
2003: {uuid: 2003,name: "新手剑3",type: EquipType.WEAPON,info:"攻击次数增加1次",
special_attr:[
{special_attr:EquipSpecialAttr.WIND,special_attr_value:1},
{special_attr:EquipSpecialAttr.DOUBLE_DEAD,special_attr_value:1},
{special_attr:EquipSpecialAttr.DOUBLE_ATKED,special_attr_value:1},
{special_attr:EquipSpecialAttr.ATK_ADD_FRIEND_ATK,special_attr_value:3},
{special_attr:EquipSpecialAttr.ATK_ADD_FRIEND_HP,special_attr_value:30},
{special_attr:EquipSpecialAttr.ATK_ADD_GLOD,special_attr_value:3},
@@ -120,36 +131,6 @@ export const EquipInfo: { [key: number]: EquipData } = {
{ type: DebuffAttr.DECD, value: 50, target: EquipAttrTarget.ENEMY },
]
},
2004: {uuid: 2004,name: "防具1",type: EquipType.ARMOR,info:"生命值增加100%",
special_attr:[
{special_attr:EquipSpecialAttr.ATK_ADD_FRIEND_ATK,special_attr_value:3},
{special_attr:EquipSpecialAttr.ATK_ADD_FRIEND_HP,special_attr_value:30},
{special_attr:EquipSpecialAttr.ATK_ADD_GLOD,special_attr_value:3},
{special_attr:EquipSpecialAttr.ATK_ADD_MASTER_ATK,special_attr_value:3},
{special_attr:EquipSpecialAttr.ATK_ADD_MASTER_HP,special_attr_value:3},
],
buff: [
{ type: BuffAttr.HP, value: 100, target: EquipAttrTarget.HERO },
],
debuff: [
{ type: DebuffAttr.DECD, value: 50, target: EquipAttrTarget.ENEMY },
]
},
2005: {uuid: 2005,name: "防具2",type: EquipType.ARMOR,info:"免伤增加50%",
special_attr:[
{special_attr:EquipSpecialAttr.ATK_ADD_FRIEND_ATK,special_attr_value:3},
{special_attr:EquipSpecialAttr.ATK_ADD_FRIEND_HP,special_attr_value:30},
{special_attr:EquipSpecialAttr.ATK_ADD_GLOD,special_attr_value:3},
{special_attr:EquipSpecialAttr.ATK_ADD_MASTER_ATK,special_attr_value:3},
{special_attr:EquipSpecialAttr.ATK_ADD_MASTER_HP,special_attr_value:3},
],
buff: [
{ type: BuffAttr.DEF, value: 50, target: EquipAttrTarget.HERO },
],
debuff: [
{ type: DebuffAttr.DECD, value: 50, target: EquipAttrTarget.ENEMY },
]
},
}

View File

@@ -143,11 +143,11 @@ export const SkillSet = {
6009:{uuid:6009,name:"飞刀打击",sp_name:"mon_xd",path:"6009",TargetType:TargetType.Frontline,TargetGroup:3,act:"atk",CdType:1,AnimType:AnimType.parabolic,endType:3,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"向最前方敌人扔出飞刀,造成100%攻击的伤害"},
6010:{uuid:6010,name:"石斧打击",sp_name:"mon_sf",path:"6010",TargetType:TargetType.Frontline,TargetGroup:3,act:"atk",CdType:1,AnimType:AnimType.parabolic,endType:3,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"向最前方敌人扔出石斧,造成100%攻击的伤害"},
6011:{uuid:6011,name:"烈火呼吸",sp_name:"firequan",path:"6011",TargetType:TargetType.Frontline,TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.parabolic,endType:1,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:3,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:0.5,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"召唤烈焰攻击前方敌人,造成200%攻击的伤害,烈焰维持3秒"},
6012:{uuid:6012,name:"大火球" ,sp_name:"fire",path:"6012",TargetType:TargetType.Frontline,TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.parabolic,endType:1,fname:"max",flash:false,with:50,debuff:2,depb:20,debtime:2,derate:100,in:1,count:1,def:0,apup:0,ap:300,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"召唤大火球攻击前方所有敌人,造成300%攻击的伤害,有一定几率施加灼烧"},
6012:{uuid:6012,name:"大火球" ,sp_name:"fire",path:"6012",TargetType:TargetType.Frontline,TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.linear,endType:1,fname:"max",flash:false,with:50,debuff:2,depb:20,debtime:2,derate:100,in:1,count:1,def:0,apup:0,ap:300,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"召唤大火球攻击前方所有敌人,造成300%攻击的伤害,有一定几率施加灼烧"},
6013:{uuid:6013,name:"火墙", sp_name:"firewall",path:"6013",TargetType:TargetType.Frontline,TargetGroup:3,act:"max",CdType:2,AnimType:4,endType:1,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:10,count:1,def:0,apup:0,ap:50,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"在最前方敌人位置,召唤一堵火墙,持续10秒,每秒造成50%攻击伤害"},
6014:{uuid:6014,name:"寒冰箭", sp_name:"arrow_blue",path:"6014",TargetType:TargetType.Frontline,TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.parabolic,endType:1,fname:"max",flash:false,with:50,debuff:1,depb:20,debtime:2,derate:0,in:1,count:1,def:0,apup:0,ap:200,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"召唤大火球攻击前方所有敌人,造成200%攻击的伤害,20%几率冰冻敌人"},
6014:{uuid:6014,name:"寒冰箭", sp_name:"arrow_blue",path:"6014",TargetType:TargetType.Frontline,TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.linear,endType:1,fname:"max",flash:false,with:50,debuff:1,depb:20,debtime:2,derate:0,in:1,count:1,def:0,apup:0,ap:200,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"召唤大火球攻击前方所有敌人,造成200%攻击的伤害,20%几率冰冻敌人"},
6015:{uuid:6015,name:"烈焰射击",sp_name:"arrow_yellow",path:"6015",TargetType:TargetType.Frontline,TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.parabolic,endType:1,fname:"max",flash:false,with:50,debuff:3,depb:20,debtime:2,derate:0,in:1,count:1,def:0,apup:0,ap:200,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"召唤大火球攻击前方所有敌人,造成200%攻击的伤害,20%几率眩晕敌人"},
6016:{uuid:6016,name:"龙卷风", sp_name:"bwind",path:"6016",TargetType:TargetType.Frontline,TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.parabolic,endType:1,fname:"max",flash:false,with:50,debuff:8,depb:50,debtime:1,derate:0,in:1,count:1,def:0,apup:0,ap:200,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"召唤大火球攻击前方所有敌人,造成200%攻击的伤害,50%几率击退敌人"},
6016:{uuid:6016,name:"龙卷风", sp_name:"bwind",path:"6016",TargetType:TargetType.Frontline,TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.linear,endType:1,fname:"max",flash:false,with:50,debuff:8,depb:50,debtime:1,derate:0,in:1,count:1,def:0,apup:0,ap:200,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"召唤大火球攻击前方所有敌人,造成200%攻击的伤害,50%几率击退敌人"},
6017:{uuid:6017,name:"生命之泉",sp_name:"heath",path:"6017",TargetType:TargetType.Frontline,TargetGroup:2,act:"max",CdType:2,AnimType:AnimType.parabolic,endType:1,fname:"max_blue",flash:true,with:50,debuff:0,depb:0,debtime:0,derate:0,in:5,count:1,def:0,apup:0,ap:100,mhp:0,hp:3,cd:5,buff_cd:1,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"5秒持续为全体友方恢复施法者最大生命值15%的生命"},
6018:{uuid:6018,name:"神圣护盾",sp_name:"shield",path:"6018",TargetType:TargetType.Frontline,TargetGroup:0,act:"max",CdType:2,AnimType:AnimType.parabolic,endType:1,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:30,speed:720,sonsk:0,hero:0,info:"召唤圣盾保护自己,可以抵御3次攻击"},
6019:{uuid:6019,name:"战争咆哮",sp_name:"apup",path:"6019",TargetType:TargetType.Frontline,TargetGroup:2,act:"max",CdType:2,AnimType:AnimType.parabolic,endType:1,fname:"max_red",flash:true,with:50,debuff:0,depb:0,debtime:0,derate:0,in:1,count:1,def:0,apup:20,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"为全体友方增加施法者攻击力20%的攻击"},

View File

@@ -79,6 +79,8 @@ export class HeroViewComp extends CCComp {
speek_time:number = 0;
is_stop_temp:boolean = false;i
Friend_alive_cd:Timer=new Timer(10)
double_dead:boolean=false
double_atked:boolean=false
private damageQueue: Array<{
damage: number,
isCrit: boolean,
@@ -142,15 +144,18 @@ export class HeroViewComp extends CCComp {
}
change_atk(e:GameEvent,data:any){
if(!this.is_master) return
if(data.ice){
this.atk_skill=6001
this.atk_skill=6014
}else if(data.fire){
this.atk_skill=6002
this.atk_skill=6012
}else if(data.wind){
this.atk_skill=6003
this.atk_skill=6016
}else{
this.atk_skill=6001
}
console.log("[HeroViewComp]:change_atk",SkillSet[this.atk_skill].name)
}
get isActive() {
@@ -258,20 +263,8 @@ export class HeroViewComp extends CCComp {
if(this.atk_count< FightSet.ATK_ADD_FRIEND_COUNT) return
if(this.FIGHTCON.atk_add_glod >0) smc.vmdata.mission_data.gold+=this.FIGHTCON.atk_add_glod
this.do_friend_atk_add()
this.do_master_atk_add()
this.atk_count=0
}
friend_count_atk_count(){ //伙伴攻击次数 有装备加成,需要单独处理
if(this.is_master) return
if(this.atk_add_count==0) return
this.atk_count+=1
if(this.atk_count < this.atk_add_count) return
}
do_friend_atk_add(){
let friends=ecs.query(ecs.allOf(FriendModelComp))
friends.forEach(friend=>{
let friend_view=friend.get(HeroViewComp)
if(this.FIGHTCON.atk_add_friend_atk>0) {
@@ -281,8 +274,7 @@ export class HeroViewComp extends CCComp {
friend_view.add_hp_max(this.FIGHTCON.atk_add_friend_hp)
}
})
}
do_master_atk_add(){
let master=ecs.query(ecs.allOf(MasterModelComp))
master.forEach(master=>{
let master_view=master.get(HeroViewComp)
@@ -293,7 +285,18 @@ export class HeroViewComp extends CCComp {
master_view.add_hp_max(this.FIGHTCON.atk_add_master_hp)
}
})
this.atk_count=0
}
friend_count_atk_count(){ //伙伴攻击次数 有装备加成,需要单独处理
if(this.is_master) return
if(this.atk_add_count==0) return
this.atk_count+=1
if(this.atk_count < this.atk_add_count) return
}
do_change(){
this.BUFFCOMP.update_info_ap()
this.BUFFCOMP.update_info_hp()
@@ -308,6 +311,7 @@ export class HeroViewComp extends CCComp {
do_dead(){
this.do_dead_trigger()
this.Friend_alive_cd=new Timer(this.FIGHTCON.friend_alive_cd)
console.log("[HeroViewComp]:角色死亡",this.hero_uuid)
if(this.is_master){
@@ -315,7 +319,9 @@ export class HeroViewComp extends CCComp {
oops.message.dispatchEvent(GameEvent.FightEnd,{victory:false})
}
}
do_atked(remainingDamage:number){
this.do_atked_trigger()
if (this.shield > 0) {
this.shield -= 1
this.BUFFCOMP.tooltip(5,"*吸收*");
@@ -334,7 +340,6 @@ export class HeroViewComp extends CCComp {
this.do_dead()
console.log("[HeroViewComp]:dead,fac => "+(this.fac==FacSet.HERO?"hero":"monster"))
if(this.ent == null) return;
if(this.fac ==FacSet.HERO){
this.to_grave()
}else{
@@ -345,11 +350,32 @@ export class HeroViewComp extends CCComp {
this.showDamage(remainingDamage, true);
}
}
dead(){
this.BUFFCOMP.dead()
this.to_drop()
// dead(){
// this.BUFFCOMP.dead()
// this.to_drop()
// }
do_dead_trigger(){
if(this.is_dead||this.fac==FacSet.MON||this.is_master) return
let count = 1
if(this.double_dead) {
console.log("[HeroViewComp]:double_dead")
count =2
}
for(let i=0;i<count;i++){
console.log("[HeroViewComp]:dead"+i+"次")
}
}
do_atked_trigger(){
if(this.is_dead||this.fac==FacSet.MON||this.is_master) return
let count = 1
if(this.double_atked) {
console.log("[HeroViewComp]:double_atked")
count =2
}
}
to_grave(){
tween(this.node).to(0.5, { position:v3(-900,this.node.position.y+300,0)},{
onComplete: (target?: object) => {

View File

@@ -69,7 +69,18 @@ export class SkillCom extends CCComp {
bm.moveTo(this.targetPos)
}
if(SkillSet[this.s_uuid].AnimType==AnimType.linear){
let tx =400
if(this.group==BoxSet.MONSTER){
tx=-400
this.node.scale=v3(this.node.scale.x*-1,1,1)
}
tween(this.node).to(1, { position:v3(tx,this.node.position.y,0)},{
onComplete: (target?: object) => {
this.node.setPosition(tx,this.node.position.y-300,0)
}
}).start()
}
// let dir_x = this.targetPos.x > this.node.position.x ? 1 : -1
// this.node.scale = v3(dir_x,1,1)
// 根据目标位置设置节点朝向

View File

@@ -16,6 +16,6 @@
- [x] 普通攻击改为寒冰攻击带冰冻(被动)
- [x] 普通攻击改为火焰攻击带易伤(被动)
- [x] 伙伴复活时间减少%(被动)
- [ ] 每攻击n次 加伙伴hp
- [ ] 每攻击n次 加伙伴ap
- [ ] 每攻击n次后 增加1金币
- [x] 每攻击n次 加伙伴hp
- [x] 每攻击n次 加伙伴ap
- [x] 每攻击n次后 增加1金币