修改机器人选择法术或随从的逻辑
This commit is contained in:
parent
e0b76dc2a6
commit
54fc69d9ef
@ -153,15 +153,16 @@ let assistantUtil = {
|
||||
let effectMap: Map<number, EffectCardCfg> = global.$cfg.get(BaseConst.EFFECTCARD);
|
||||
let spellCards: Card[] = [];
|
||||
// 优先取随从
|
||||
let petCount = 1;
|
||||
let petCount = 0;
|
||||
for (let [,pet] of dstPlayer.pets) {
|
||||
if (pet.state == 1) petCount ++;
|
||||
if (pet.state == 1 && !pet.isHero) petCount ++;
|
||||
}
|
||||
let noMorePet = petCount >= new GameEnv().maxPlayerPetCount;
|
||||
let noPet = Math.random2(0, 100) > 70;
|
||||
for (let card of cards) {
|
||||
let effect = effectMap.get(card.effect);
|
||||
// if (effect.type_id == EffectType.unit && dstPlayer.unitCfgs.has(card.effect + '')) {
|
||||
if (card.type == CardType.variable_unit && !noMorePet) {
|
||||
if (card.type == CardType.variable_unit && !noMorePet && !noPet) {
|
||||
result = card;
|
||||
break;
|
||||
} else if (effect.type_id == EffectType.skill) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user