import { afterSkillType } from "../fightType";
import { PassiveSkillBase } from "./passiveSkillBase";
import * as PassiveClass from "./passiveSkillExtends";

export function runPassiveSkillBase(skillInfo: afterSkillType) {
    let skillConf = skillInfo.skillConf;
    let toRole = skillInfo.toRole;
    let bdId = skillConf.bdid;

    let _class: PassiveSkillBase = null;
    if (PassiveClass['PassiveSkill_' + bdId]) {
        _class = new PassiveClass['PassiveSkill_' + bdId](skillInfo);
    } else {
        _class = new PassiveSkillBase(skillInfo);
    }
    toRole.passiveSkills[_class._passiveId] = _class;
    _class.start();

}