public Target(bool TargetAlly, bool aOE, int numberOfTargets, CastTarget castTarget)
 {
     this.TargetAlly = TargetAlly;
     MultiTargeted   = aOE;
     NumberOfTargets = numberOfTargets;
     CastTarget      = castTarget;
 }
        private static CellObject GetTargetedCell(FightStatus fightStatus, CastTarget castTarget)
        {
            //IL_0055: Unknown result type (might be due to invalid IL or missing references)
            //IL_005a: Unknown result type (might be due to invalid IL or missing references)
            FightMap current = FightMap.current;

            if (null == current)
            {
                return(null);
            }
            switch (castTarget.ValueCase)
            {
            case CastTarget.ValueOneofCase.Cell:
            {
                CellCoord cell = castTarget.Cell;
                return(current.GetCellObject(cell.X, cell.Y));
            }

            case CastTarget.ValueOneofCase.EntityId:
            {
                int entityId = castTarget.EntityId;
                if (fightStatus.TryGetEntity(entityId, out IEntityWithBoardPresence entityStatus))
                {
                    Vector2Int refCoord = entityStatus.area.refCoord;
                    return(current.GetCellObject(refCoord.get_x(), refCoord.get_y()));
                }
                return(null);
            }

            default:
                return(null);
            }
        }
Exemple #3
0
    protected override void CastInternal(Unit caster, List <CastTarget> targets)
    {
        CastTarget target = targets[0];

        oldController       = caster.ActiveController;
        targetStartPosition = target.Unit.gameObject.transform.position;

        chargeController        = caster.gameObject.AddComponent <ChargeController>();
        chargeController.Target = new TargetInfo(caster, target.Unit);
        chargeController.Initialize(this);
    }
 public Target(bool TargetAlly, CastTarget castTarget) : this(TargetAlly, false, 1, castTarget)
 {
 }