public void mod_RunAction() { BlueprintSummonPool bpSummonPool = this.SummonPool; if (bpSummonPool == null) { return; } ISummonPool summonPool = GameHelper.GetSummonPool(bpSummonPool); IEnumerable <UnitEntityData> units = summonPool?.Units.ToList(); if (units == null) { return; } foreach (UnitEntityData unit in units.Where(unit => unit != null)) { using (new SummonPoolUnitData(unit)) { if (this.Conditions.Check()) { this.Actions.Run(); } } } }
int getUsedHD(MechanicsContext context, BlueprintSummonPool summon_pool) { ISummonPool pool = Game.Instance.SummonPools.GetPool(this.SummonPool); if (pool == null) { return(0); } int used_hd = 0; foreach (UnitEntityData unit in pool.Units) { if (unit.Get <UnitPartSummonedMonster>().Summoner == context.MaybeCaster) { used_hd += unit.Descriptor.Progression.CharacterLevel; } } return(used_hd); }
int getUsedUnits(MechanicsContext context, BlueprintSummonPool summon_pool) { ISummonPool pool = Game.Instance.SummonPools.GetPool(this.SummonPool); if (pool == null) { return(0); } int units = 0; foreach (UnitEntityData unit in pool.Units) { if (unit.Get <UnitPartSummonedMonster>().Summoner == context.MaybeCaster) { units += 1; } } return(units); }