修改英雄卡组生成策略
This commit is contained in:
parent
7db4cce080
commit
a6363d30fa
@ -39,13 +39,28 @@ export class SelectHeroCommand extends Command<CardGameState, { client: Client,
|
||||
if (unitData.base_skill2id) heroPet.skills.push(unitData.base_skill2id);
|
||||
if (unitData.base_skill3id) heroPet.skills.push(unitData.base_skill3id);
|
||||
let petInitData: number[][] = [];
|
||||
const effectMap = global.$cfg.get(BaseConst.EFFECTCARD);
|
||||
for (let i = 1; i < 10; i++) {
|
||||
if (!heroData[`follower${i}id`]) {
|
||||
break;
|
||||
}
|
||||
let subData: number[] = [];
|
||||
subData.push(heroData[`follower${i}id`]);
|
||||
subData.push(heroData[`follower${i}`]);
|
||||
let unitId = heroData[`follower${i}id`];
|
||||
|
||||
let weight = 0;
|
||||
let effectId;
|
||||
for (let [,eff] of effectMap) {
|
||||
if (eff.stageunit_id == unitId) {
|
||||
weight = eff.weight;
|
||||
effectId = eff.id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!effectId) {
|
||||
error(`未找到效果卡的配置: ${unitId}`);
|
||||
}
|
||||
subData.push(effectId);
|
||||
subData.push(weight);
|
||||
petInitData.push(subData);
|
||||
}
|
||||
player.unitCfgs = petInitData;
|
||||
|
Loading…
x
Reference in New Issue
Block a user