天赋完善 继续

This commit is contained in:
2025-07-30 22:25:31 +08:00
parent c3ecc08767
commit 23ef6c3ca0
6 changed files with 170 additions and 43 deletions

View File

@@ -56952,6 +56952,8 @@
"__id__": 0
},
"fileId": "52c6grQdZMj6PgsSTZQQC8",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
@@ -80435,6 +80437,8 @@
"__id__": 0
},
"fileId": "ccF3sQM4RKnoAN+hM3dDG5",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{

View File

@@ -92,7 +92,7 @@ export class Hero extends ecs.Entity {
hv.cd = hv.cd_base = hero.cd
hv.hp= hv.hp_max = hv.hp_base=hero.hp+info.hp
hv.ap = hv.ap_base=hero.ap+info.ap;
hv.def = hv.def_base=hero.def+info.def;
hv.def =hero.def+info.def;
hero.buff.forEach((buff:any)=>{
switch(buff.buff_type){
case BuffAttr.CRITICAL:

View File

@@ -8,6 +8,7 @@ import { HeroViewComp } from "./HeroViewComp";
import { BuffAttr } from "../common/config/SkillSet";
import { EnhancementType } from "../common/config/LevelUp";
import { TalentList } from "../common/config/TalentSet";
import { smc } from "../common/SingletonModuleComp";
const { ccclass, property } = _decorator;
@@ -46,14 +47,13 @@ export class HeroConComp extends CCComp {
this.heroView.add_ap(buff.value,true)
break
case BuffAttr.ATK:
console.log("[HeroConCompComp]:equip_add ,buff.value",buff.value,this.heroView)
this.heroView.add_ap(buff.value,false)
break
case BuffAttr.ATK_CD:
this.heroView.add_speed(buff.value)
break
case BuffAttr.DEF:
this.heroView.add_def(buff.value)
this.heroView.change_def(buff.value)
break
case BuffAttr.HP:
this.heroView.add_hp_max(buff.value,false)
@@ -61,6 +61,12 @@ export class HeroConComp extends CCComp {
case BuffAttr.HP_MAX:
this.heroView.add_hp_max(buff.value,true)
break
case BuffAttr.CRITICAL:
this.heroView.change_crit(buff.value)
break
case BuffAttr.CRITICAL_DMG:
this.heroView.change_crit_d(buff.value)
break
}
}
}
@@ -88,7 +94,7 @@ export class HeroConComp extends CCComp {
this.heroView.add_hp_max(data.value,true)
break
case EnhancementType.DEF:
this.heroView.add_def(data.value)
this.heroView.change_def(data.value)
break
}
}
@@ -105,20 +111,96 @@ export class HeroConComp extends CCComp {
this.heroView.TALENT[BuffAttr.ATK_CD]+=tal.value
this.heroView.count_atrr(BuffAttr.ATK_CD)
break
case BuffAttr.SKILL_CD:
smc.vmdata.hero.skill_cd_buff+=tal.value //直接加到vmdata中
break
case BuffAttr.HP:
this.heroView.TALENT[BuffAttr.HP]+=tal.value
this.heroView.count_atrr(BuffAttr.HP)
break
case BuffAttr.DEF:
this.heroView.change_def(tal.value)
break
case BuffAttr.CRITICAL:
this.heroView.TALENT[BuffAttr.CRITICAL]+=tal.value
this.heroView.change_crit(tal.value)
break
case BuffAttr.CRITICAL_DMG:
this.heroView.TALENT[BuffAttr.CRITICAL_DMG]+=tal.value
this.heroView.change_crit_d(tal.value)
break
case BuffAttr.DODGE:
this.heroView.TALENT[BuffAttr.DODGE]+=tal.value
this.heroView.change_dodge(tal.value)
break
case BuffAttr.DEBUFF_COUNT:
this.heroView.TALENT[BuffAttr.DEBUFF_COUNT]+=tal.value
case BuffAttr.PUNCTURE:
this.heroView.change_puncture(tal.value)
break
case BuffAttr.PUNCTURE_DMG:
this.heroView.change_puncture_damage(tal.value)
break
case BuffAttr.FROST_RATIO:
this.heroView.change_frost_ratto(tal.value)
break
case BuffAttr.KNOCKBACK:
this.heroView.change_knockback(tal.value)
break
case BuffAttr.STUN_RATTO:
this.heroView.change_stun_ratto(tal.value)
break
case BuffAttr.REFLECT:
this.heroView.change_reflect(tal.value)
break
case BuffAttr.LIFESTEAL:
this.heroView.change_lifesteal(tal.value)
break
}
}
remove_talent_card(e:GameEvent,data:any){
console.log("[HeroConCompComp]:remove_talent_card",data)
let tal=TalentList[data.uuid]
switch(tal.buffType){
case BuffAttr.ATK:
this.heroView.TALENT[BuffAttr.ATK]-=tal.value
this.heroView.count_atrr(BuffAttr.ATK)
break
case BuffAttr.ATK_CD:
this.heroView.TALENT[BuffAttr.ATK_CD]-=tal.value
this.heroView.count_atrr(BuffAttr.ATK_CD)
break
case BuffAttr.HP:
this.heroView.TALENT[BuffAttr.HP]-=tal.value
break
case BuffAttr.DEF:
this.heroView.change_def(-tal.value)
break
case BuffAttr.CRITICAL:
this.heroView.change_crit(-tal.value)
break
case BuffAttr.CRITICAL_DMG:
this.heroView.change_crit_d(-tal.value)
break
case BuffAttr.DODGE:
this.heroView.change_dodge(-tal.value)
break
case BuffAttr.PUNCTURE:
this.heroView.change_puncture(-tal.value)
break
case BuffAttr.PUNCTURE_DMG:
this.heroView.change_puncture_damage(-tal.value)
break
case BuffAttr.FROST_RATIO:
this.heroView.change_frost_ratto(-tal.value)
break
case BuffAttr.KNOCKBACK:
this.heroView.change_knockback(-tal.value)
break
case BuffAttr.STUN_RATTO:
this.heroView.change_stun_ratto(-tal.value)
break
case BuffAttr.REFLECT:
this.heroView.change_reflect(-tal.value)
break
case BuffAttr.LIFESTEAL:
this.heroView.change_lifesteal(-tal.value)
break
}
}

View File

@@ -66,14 +66,13 @@ export class HeroViewComp extends CCComp {
atk_skill:number=0;
puncture:number=0; //穿刺敌人伤害后方敌人个数
puncture_damage:number=0; //后伤害加成
def: number = 0; //防御
def_base:number=0;
def_buff:number=0;
def: number = 0; //免伤
vun: number = 0; //易伤
burn_count:number=0; //易伤次数
burn_value:number=0; //易伤值
stun_time:number=0; //眩晕加成
stun_ratto:number=0; //攻击眩晕概率加成
stun_no:boolean=false; //眩晕免疫
dod: number = 0; //闪避率
dod_no:boolean=false;
crit:number=0; //暴击率
@@ -82,10 +81,14 @@ export class HeroViewComp extends CCComp {
wfuny:number=0; //风怒概率
frost_ratto:number=0; //冰冻概率
frost_time:number=0; //冰冻时间
frost_no:boolean=false; //冰冻免疫
knockback:number=0; //击退概率
knockback_no:boolean=false; //击退免疫
shield:number = 0; //护盾,免伤1次减1
speed: number = 100; /** 角色移动速度 */
ospeed: number = 100; /** 角色初始速度 */
reflect:number=0; //反射伤害比率
lifesteal:number=0; //吸血比率
atk_count: number = 0;
atked_count: number = 0;
@@ -228,21 +231,70 @@ export class HeroViewComp extends CCComp {
if(this.shield>6) this.shield=6
if(this.shield>0) this.BUFFCOMP.show_shield(true)
}
// add_cd(cd: number){
// this.cd += this.cd*((100-cd)/100);
// this.BUFFCOMP.buff_get("cd")
// }
change_puncture(puncture: number){
this.puncture+=puncture
if(this.puncture<1) this.puncture=1
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
change_puncture_damage(puncture_damage: number){
this.puncture_damage+=puncture_damage
if(this.puncture_damage<0) this.puncture_damage=0
if(this.puncture_damage>80) this.puncture_damage=80
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
change_dodge(dodge: number){
this.dod+=dodge
if(this.dod<0) this.dod=0
if(this.dod>90) this.dod=90
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
change_frost_ratto(frost_ratto: number){
this.frost_ratto+=frost_ratto
if(this.frost_ratto<0) this.frost_ratto=0
if(this.frost_ratto>90) this.frost_ratto=90
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
/**
* 增加英雄的攻击AP
* @param ap 要增加的攻击。
*/
add_def(def: number){
this.def_base+=def
this.count_atrr(BuffAttr.DEF)
change_knockback(knockback: number){
this.knockback+=knockback
if(this.knockback<0) this.knockback=0
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
change_stun_ratto(stun_ratto: number){
this.stun_ratto+=stun_ratto
if(this.stun_ratto<0) this.stun_ratto=0
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
change_def(def: number){
this.def+=def
if(this.def>90) this.def=90
if(this.def<0) this.def=0
if(this.is_master) this.BUFFCOMP.vmdata_update()
// this.BUFFCOMP.tooltip(TooltipTypes.defup,def.toFixed(0));
}
change_crit(crit: number){
this.crit+=crit
if(this.crit<0) this.crit=0
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
change_crit_d(crit_d: number){
this.crit_d+=crit_d
if(this.crit_d<0) this.crit_d=0
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
change_reflect(reflect: number){
this.reflect+=reflect
if(this.reflect<0) this.reflect=0
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
change_lifesteal(lifesteal: number){
this.lifesteal+=lifesteal
if(this.lifesteal<0) this.lifesteal=0
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
check_atrr(buff:BuffAttr){
switch(buff){
case BuffAttr.ATK:
@@ -251,8 +303,7 @@ export class HeroViewComp extends CCComp {
return this.cd_base/((this.cd_buff+this.TALENT[BuffAttr.ATK_CD])/100+1)
case BuffAttr.HP:
return Math.floor(this.hp_base*(100+this.hp_buff+this.TALENT[BuffAttr.HP])/100)
case BuffAttr.DEF:
return this.def_base+this.def_buff+this.TALENT[BuffAttr.DEF]
}
}
@@ -270,18 +321,14 @@ export class HeroViewComp extends CCComp {
if(this.is_master) this.BUFFCOMP.vmdata_update()
break
case BuffAttr.HP:
let diff=this.check_atrr(BuffAttr.HP)-this.hp_max
this.hp_max=this.check_atrr(BuffAttr.HP)
this.hp+=diff
if(this.is_master) this.BUFFCOMP.vmdata_update(true)
break
case BuffAttr.DEF:
this.def=this.check_atrr(BuffAttr.DEF)
if(this.is_master) this.BUFFCOMP.vmdata_update()
break
}
}
add_speed(cd: number){
this.cd_buff+=cd
this.count_atrr(BuffAttr.ATK_CD)
@@ -296,7 +343,6 @@ export class HeroViewComp extends CCComp {
}else{
this.ap += Math.floor(ap);
}
let diff=this.check_atrr(BuffAttr.ATK)-this.ap
this.count_atrr(BuffAttr.ATK)
// this.BUFFCOMP.tooltip(TooltipTypes.apup,diff.toFixed(0));
}
@@ -308,7 +354,6 @@ export class HeroViewComp extends CCComp {
}else{
this.ap -= Math.floor(ap/100*this.ap);
}
let diff=this.check_atrr(BuffAttr.ATK)-this.ap
this.count_atrr(BuffAttr.ATK)
}
@@ -319,18 +364,14 @@ export class HeroViewComp extends CCComp {
}else{
this.hp_buff+=hp
}
let diff=this.check_atrr(BuffAttr.HP)-this.hp_max
this.count_atrr(BuffAttr.HP)
this.hp+=diff
// this.BUFFCOMP.tooltip(TooltipTypes.hpup,diff.toFixed(0));
}
de_hp_max(hp: number=0,is_num:boolean=true){ //最大值 只存在数值添加, 比例通过hp_buff处理
//console.log("[HeroViewComp]:de_hp_max de:",hp,this.hp_max)
this.hp_base -= Math.floor(hp) ;
let diff=this.check_atrr(BuffAttr.HP)-this.hp_max
this.count_atrr(BuffAttr.HP)
this.hp+=diff
if(this.is_master) this.BUFFCOMP.vmdata_update(true)
}

View File

@@ -78,7 +78,7 @@ export class EquipSkillComp extends CCComp {
update(dt: number): void {
if(!smc.mission.play||smc.mission.pause) return
if(this.skill1.uuid!=0){
let cd=this.skill1.cd*(100-smc.vmdata.hero.skill_cd_buff)/100
let cd=this.skill1.cd/((smc.vmdata.hero.skill_cd_buff)/100+1)
if(this.skill1.cd_time < cd){
this.skill1.cd_time+=dt
}else{

View File

@@ -92,7 +92,7 @@ export class MissionComp extends CCComp {
count_tal(){
let count=0
for(let i=0;i<6;i++){
for(let i=0;i<5;i++){
if(this.tals[i]){
count++
}
@@ -102,7 +102,7 @@ export class MissionComp extends CCComp {
do_mon_dead(){
smc.vmdata.mission_data.mon_num--
if(smc.vmdata.mission_data.mon_num<=0) {
if(smc.vmdata.mission_data.mon_num<=0 && this.count_tal() < 6) {
if(smc.vmdata.mission_data.current_wave == RogueTalWave[this.count_tal()].wave){
console.log("[MissionComp] 怪物全死亡后触发天赋奖励",RogueTalWave[this.count_tal()].tal_slot_key)
oops.message.dispatchEvent(GameEvent.TalentSelect,{slot:TalentSlot[this.count_tal()]})