Beispiel #1
0
    public void GetTargetsInAreaOfEffect(ProjectionManager pm, Unit caster)
    {
        Targets = new List <Unit>();
        foreach (Cell cell in pm.AreaOfEffect)
        {
            pm.ColorCell(cell.X, cell.Z, Color.magenta);
            if (cell.IsTaken)
            {
                if (!HitSelf && cell.IsTaken == caster)
                {
                    continue;
                }

                if (!HitAllies && cell.IsTaken.Team == caster.Team)
                {
                    continue;
                }

                if (!HitEnemies && cell.IsTaken.Team != caster.Team)
                {
                    continue;
                }

                Targets.Add(cell.IsTaken);
            }
        }
        pm.EnableProjections(pm.Selection, true);
    }
Beispiel #2
0
    public void DisplayRange(ProjectionManager pm, Cell currentCell, Rotation currentRotation)
    {
        pm.ClearProjections();
        if (Rotation.Length == 0)
        {
            pm.SelectCells(RangeType, currentCell,
                           MinRange,
                           MaxRange,
                           NeedLineOfSight,
                           TargetMustBeEmpty,
                           NeedPathToTarget,
                           true,
                           false,
                           SelectionState.DisplaySkillRange);
        }
        else
        {
            foreach (RelativeRotation relativeRotation in Rotation)
            {
                pm.SelectCells(RangeType, currentCell,
                               MinRange,
                               MaxRange,
                               NeedLineOfSight,
                               TargetMustBeEmpty,
                               NeedPathToTarget,
                               true,
                               false,
                               SelectionState.DisplaySkillRange,
                               relativeRotation,
                               currentRotation);
            }
        }
        pm.ColorProjections(pm.Selection, Color.cyan);
        pm.EnableProjections(pm.Selection, true);

        if (NeedLineOfSight)
        {
            pm.ColorProjections(pm.NotInLOS, Color.grey);
            pm.EnableProjections(pm.NotInLOS, true);
        }
    }