Exemple #1
0
    private void OnEnemyInit(object obj)
    {
        Dictionary <int, EnemyInstance> enemys = _battleModel.GetEnemys();

        foreach (var kv in enemys)
        {
            _dicEnemyAction.Add(kv.Key, EnemyActionReg.GetAction(kv.Value.template.nId));
        }
    }
Exemple #2
0
 private void InitEnemy()
 {
     foreach (var kv in _battleModel.GetEnemys())
     {
         ftEnemy.Init(kv.Value); //todo 初始化多个敌人
         RefreshEnemyArmor(kv.Value);
         break;
     }
 }
Exemple #3
0
    public override void DoEffect(BattleManager battlemgr, CardInstance cardInstance, CardEffectTemplate effectTplt, int targetInstId)
    {
        int         iCount      = BattleTool.GetCardEffectCount(effectTplt);
        BattleModel battleModel = BattleModel.Inst;

        if (effectTplt.nTarget == CardEffectTargetType.ONE_ENEMY)
        {
            battleModel.AddBuff(battleModel.selfData, battleModel.GetEnemy(targetInstId), (uint)effectTplt.iEffectValue, iCount);
        }
        else if (effectTplt.nTarget == CardEffectTargetType.ALL_ENEMY)
        {
            foreach (KeyValuePair <int, EnemyInstance> pair in battleModel.GetEnemys())
            {
                battleModel.AddBuff(battleModel.selfData, pair.Value, (uint)effectTplt.iEffectValue, iCount);
            }
        }
        else if (effectTplt.nTarget == CardEffectTargetType.SELF)
        {
            battleModel.AddBuff(battleModel.selfData, battleModel.selfData, (uint)effectTplt.iEffectValue, iCount);
        }
        return;
    }