Example #1
0
		bool CheckForSpellStructuresCollisions(LinearSpell spell, Rect spellRect, TeamStructures enemyStructures)
		{
			foreach (IStructure structure in enemyStructures.Structures) {
				if (structure.Alive && // not a destroyed target
				    enemyStructures.IsDestructible(structure.Type) && // not an indestructible target
					spell.Info.Kind == SpellKind.OffensiveSkillshot && // offensive spell
					structure.Rectangle.Intersects(spellRect)) { // we hit it

					structure.Hurt(spell.Info.Value); // we hurt it

					return true;
				}
			}

			return false;
		}