refactor(hero): 修改TalComp中属性效果处理逻辑
将永久属性效果的处理从直接修改属性值改为添加buff配置,提高代码可维护性和一致性
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
|
import { basename } from "path/win32";
|
||||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||||
import { BType } from "../common/config/HeroAttrs";
|
import { Attrs, BType } from "../common/config/HeroAttrs";
|
||||||
|
import { BuffConf } from "../common/config/SkillSet";
|
||||||
import { TalAttrs, talConf, TalEffet, TalTarget, TriType} from "../common/config/TalSet";
|
import { TalAttrs, talConf, TalEffet, TalTarget, TriType} from "../common/config/TalSet";
|
||||||
import { HeroAttrsComp } from "./HeroAttrsComp";
|
import { HeroAttrsComp } from "./HeroAttrsComp";
|
||||||
import { HeroViewComp } from "./HeroViewComp";
|
import { HeroViewComp } from "./HeroViewComp";
|
||||||
@@ -229,11 +231,12 @@ export class TalComp extends ecs.Comp {
|
|||||||
case TalEffet.C_MSKILL:
|
case TalEffet.C_MSKILL:
|
||||||
heroAttrs.addCountTal(TalEffet.C_MSKILL, talent.value + talent.value_add);
|
heroAttrs.addCountTal(TalEffet.C_MSKILL, talent.value + talent.value_add);
|
||||||
break;
|
break;
|
||||||
case TalEffet.BUFF:
|
case TalEffet.BUFF: //临时buff
|
||||||
heroAttrs.addValueTal(talent.uuid, talent.attrs, talent.vType, talent.value + talent.value_add);
|
heroAttrs.addValueTal(talent.uuid, talent.attrs, talent.vType, talent.value + talent.value_add);
|
||||||
break;
|
break;
|
||||||
case TalEffet.ATTR:
|
case TalEffet.ATTR: //永久属性
|
||||||
heroAttrs.addValueTal(talent.uuid, talent.attrs, talent.vType, talent.value + talent.value_add);
|
let b:BuffConf={buff:Attrs[TalAttrs[talent.attrs]],BType:talent.vType,value:talent.value,time:0, chance:100, }
|
||||||
|
heroAttrs.addBuff(b);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user