示例#1
0
    protected float GetNumberOfTurnToReachTargetWithCapacities(BattleSimulationUnit unit, BattleSimulationTarget potentialTarget)
    {
        float result        = 0f;
        float propertyValue = unit.GetPropertyValue(SimulationProperties.BattleMaximumMovement);

        if (propertyValue != 0f)
        {
            result = unit.GetDistanceByGround(potentialTarget.StaticPosition) / propertyValue;
        }
        return(result);
    }
示例#2
0
    protected float GetRatioDistanceToAttackAndMoveRange(BattleSimulationUnit unit, BattleSimulationTarget potentialTarget)
    {
        float result           = 0f;
        float distanceByGround = unit.GetDistanceByGround(potentialTarget.StaticPosition);

        if (distanceByGround > 0f)
        {
            float propertyValue  = unit.GetPropertyValue(SimulationProperties.BattleMaximumMovement);
            float propertyValue2 = unit.GetPropertyValue(SimulationProperties.BattleRange);
            result = distanceByGround / (propertyValue + propertyValue2);
        }
        return(result);
    }
示例#3
0
    protected bool IsTargetWithinMovementRange(BattleSimulationUnit unit, BattleSimulationTarget potentialTarget)
    {
        float distanceByGround = unit.GetDistanceByGround(potentialTarget.StaticPosition);

        return(distanceByGround <= unit.GetPropertyValue(SimulationProperties.BattleMovement));
    }